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" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 83 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 84 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 85 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 86 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 87 | else |
| 88 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 89 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 90 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 91 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 92 | O_NEXT_CLI=false |
| 93 | fi |
| 94 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 95 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | 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] | 97 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 98 | else |
| 99 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 100 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 101 | fi |
| 102 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 103 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 104 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 105 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 106 | else |
| 107 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 108 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 109 | fi |
| 110 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 111 | TESTS=0 |
| 112 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 113 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 114 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 115 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 116 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 117 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 118 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 119 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 120 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 121 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 122 | RUN_TEST_NUMBER='' |
| 123 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 124 | PRESERVE_LOGS=0 |
| 125 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 126 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 127 | # port which is this plus 10000. Each port number may be independently |
| 128 | # overridden by a command line option. |
| 129 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 130 | PXY_PORT=$((SRV_PORT + 10000)) |
| 131 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 132 | print_usage() { |
| 133 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 134 | printf " -h|--help\tPrint this help.\n" |
| 135 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 136 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 137 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 138 | 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] | 139 | 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] | 140 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 141 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 142 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 143 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 144 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 145 | 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] | 146 | } |
| 147 | |
| 148 | get_options() { |
| 149 | while [ $# -gt 0 ]; do |
| 150 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 151 | -f|--filter) |
| 152 | shift; FILTER=$1 |
| 153 | ;; |
| 154 | -e|--exclude) |
| 155 | shift; EXCLUDE=$1 |
| 156 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 157 | -m|--memcheck) |
| 158 | MEMCHECK=1 |
| 159 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 160 | -n|--number) |
| 161 | shift; RUN_TEST_NUMBER=$1 |
| 162 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 163 | -s|--show-numbers) |
| 164 | SHOW_TEST_NUMBER=1 |
| 165 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 166 | -p|--preserve-logs) |
| 167 | PRESERVE_LOGS=1 |
| 168 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | --port) |
| 170 | shift; SRV_PORT=$1 |
| 171 | ;; |
| 172 | --proxy-port) |
| 173 | shift; PXY_PORT=$1 |
| 174 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 175 | --seed) |
| 176 | shift; SEED="$1" |
| 177 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 178 | -h|--help) |
| 179 | print_usage |
| 180 | exit 0 |
| 181 | ;; |
| 182 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 183 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | print_usage |
| 185 | exit 1 |
| 186 | ;; |
| 187 | esac |
| 188 | shift |
| 189 | done |
| 190 | } |
| 191 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 192 | # Make the outcome file path relative to the original directory, not |
| 193 | # to .../tests |
| 194 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 195 | [!/]*) |
| 196 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 197 | ;; |
| 198 | esac |
| 199 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 200 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 201 | # testing. Skip non-boolean options (with something other than spaces |
| 202 | # and a comment after "#define SYMBOL"). The variable contains a |
| 203 | # space-separated list of symbols. |
Jerry Yu | d0fcf7f | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 204 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 205 | # Skip next test; use this macro to skip tests which are legitimate |
| 206 | # in theory and expected to be re-introduced at some point, but |
| 207 | # aren't expected to succeed at the moment due to problems outside |
| 208 | # our control (such as bugs in other TLS implementations). |
| 209 | skip_next_test() { |
| 210 | SKIP_NEXT="YES" |
| 211 | } |
| 212 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 213 | # 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] | 214 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 216 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | *) SKIP_NEXT="YES";; |
| 218 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 219 | } |
| 220 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 221 | # 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] | 222 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 223 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 224 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 225 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 226 | } |
| 227 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 228 | requires_all_configs_enabled() { |
| 229 | if ! $P_QUERY -all $* |
| 230 | then |
| 231 | SKIP_NEXT="YES" |
| 232 | fi |
| 233 | } |
| 234 | |
| 235 | requires_all_configs_disabled() { |
| 236 | if $P_QUERY -any $* |
| 237 | then |
| 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
| 242 | requires_any_configs_enabled() { |
| 243 | if ! $P_QUERY -any $* |
| 244 | then |
| 245 | SKIP_NEXT="YES" |
| 246 | fi |
| 247 | } |
| 248 | |
| 249 | requires_any_configs_disabled() { |
| 250 | if $P_QUERY -all $* |
| 251 | then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 256 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 257 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 258 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 259 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 260 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 261 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 262 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 263 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 264 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 265 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 266 | then |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 267 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 268 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 269 | then |
| 270 | SKIP_NEXT="YES" |
| 271 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 272 | } |
| 273 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 274 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 275 | # This function uses the query_config command line option to query the |
| 276 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 277 | # program. The command will always return a success value if the |
| 278 | # configuration is defined and the value will be printed to stdout. |
| 279 | # |
| 280 | # Note that if the configuration is not defined or is defined to nothing, |
| 281 | # the output of this function will be an empty string. |
| 282 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 286 | VAL="$( get_config_value_or_default "$1" )" |
| 287 | if [ -z "$VAL" ]; then |
| 288 | # Should never happen |
| 289 | echo "Mbed TLS configuration $1 is not defined" |
| 290 | exit 1 |
| 291 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 292 | SKIP_NEXT="YES" |
| 293 | fi |
| 294 | } |
| 295 | |
| 296 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 297 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 298 | if [ -z "$VAL" ]; then |
| 299 | # Should never happen |
| 300 | echo "Mbed TLS configuration $1 is not defined" |
| 301 | exit 1 |
| 302 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 303 | SKIP_NEXT="YES" |
| 304 | fi |
| 305 | } |
| 306 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 307 | requires_config_value_equals() { |
| 308 | VAL=$( get_config_value_or_default "$1" ) |
| 309 | if [ -z "$VAL" ]; then |
| 310 | # Should never happen |
| 311 | echo "Mbed TLS configuration $1 is not defined" |
| 312 | exit 1 |
| 313 | elif [ "$VAL" -ne "$2" ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 318 | # Require Mbed TLS to support the given protocol version. |
| 319 | # |
| 320 | # Inputs: |
| 321 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 322 | requires_protocol_version() { |
| 323 | # Support for DTLS is detected separately in detect_dtls(). |
| 324 | case "$1" in |
| 325 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 326 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 327 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 328 | esac |
| 329 | } |
| 330 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 331 | # Space-separated list of ciphersuites supported by this build of |
| 332 | # Mbed TLS. |
| 333 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 334 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 335 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 336 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 337 | case $P_CIPHERSUITES in |
| 338 | *" $1 "*) :;; |
| 339 | *) SKIP_NEXT="YES";; |
| 340 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 341 | } |
| 342 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 343 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 344 | # If CMD (call to a TLS client or server program) requires certain features, |
| 345 | # arrange to only run the following test case if those features are enabled. |
| 346 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 347 | case "$1" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 348 | *\ force_version=*) |
| 349 | tmp="${1##*\ force_version=}" |
| 350 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 351 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 352 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 353 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 354 | case "$1" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 355 | *\ force_ciphersuite=*) |
| 356 | tmp="${1##*\ force_ciphersuite=}" |
| 357 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 358 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 359 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 360 | |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 361 | case " $1 " in |
| 362 | *[-_\ =]tickets=[^0]*) |
| 363 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 364 | esac |
| 365 | case " $1 " in |
| 366 | *[-_\ =]alpn=*) |
| 367 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 368 | esac |
| 369 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 370 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 371 | } |
| 372 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 373 | requires_certificate_authentication () { |
| 374 | if [ "$PSK_ONLY" = "YES" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 379 | adapt_cmd_for_psk () { |
| 380 | case "$2" in |
| 381 | *openssl*) s='-psk abc123 -nocert';; |
| 382 | *gnutls-*) s='--pskkey=abc123';; |
| 383 | *) s='psk=abc123';; |
| 384 | esac |
| 385 | eval $1='"$2 $s"' |
| 386 | unset s |
| 387 | } |
| 388 | |
| 389 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 390 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 391 | # |
| 392 | # If not running in a PSK-only build, do nothing. |
| 393 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 394 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 395 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 396 | # a pre-shared key, do nothing. |
| 397 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 398 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 399 | # |
| 400 | # Inputs: |
| 401 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 402 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 403 | # * "$@": options passed to run_test. |
| 404 | # |
| 405 | # Outputs: |
| 406 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 407 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 408 | maybe_adapt_for_psk() { |
| 409 | if [ "$PSK_ONLY" != "YES" ]; then |
| 410 | return |
| 411 | fi |
| 412 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 413 | return |
| 414 | fi |
| 415 | case "$CLI_CMD $SRV_CMD" in |
| 416 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 417 | return;; |
| 418 | *force_ciphersuite*) |
| 419 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 420 | # PSK cipher suite could be substituted, but we're not ready for |
| 421 | # that yet. |
| 422 | SKIP_NEXT="YES" |
| 423 | return;; |
| 424 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 425 | # The test case involves certificates. PSK won't do. |
| 426 | SKIP_NEXT="YES" |
| 427 | return;; |
| 428 | esac |
| 429 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 430 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 431 | } |
| 432 | |
| 433 | case " $CONFIGS_ENABLED " in |
| 434 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 435 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 436 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 437 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 438 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 439 | *) PSK_ONLY="NO";; |
| 440 | esac |
| 441 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 442 | HAS_ALG_SHA_1="NO" |
| 443 | HAS_ALG_SHA_224="NO" |
| 444 | HAS_ALG_SHA_256="NO" |
| 445 | HAS_ALG_SHA_384="NO" |
| 446 | HAS_ALG_SHA_512="NO" |
| 447 | |
| 448 | check_for_hash_alg() |
| 449 | { |
| 450 | CURR_ALG="INVALID"; |
| 451 | USE_PSA="NO" |
| 452 | case $CONFIGS_ENABLED in |
| 453 | *" MBEDTLS_USE_PSA_CRYPTO"[\ =]*) |
| 454 | USE_PSA="YES"; |
| 455 | ;; |
| 456 | *) :;; |
| 457 | esac |
| 458 | if [ $USE_PSA = "YES" ]; then |
| 459 | CURR_ALG=PSA_WANT_ALG_${1} |
| 460 | else |
| 461 | CURR_ALG=MBEDTLS_${1}_C |
| 462 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 463 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 464 | fi |
| 465 | |
| 466 | case $CONFIGS_ENABLED in |
| 467 | *" $CURR_ALG"[\ =]*) |
| 468 | return 0 |
| 469 | ;; |
| 470 | *) :;; |
| 471 | esac |
| 472 | return 1 |
| 473 | } |
| 474 | |
| 475 | populate_enabled_hash_algs() |
| 476 | { |
| 477 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 478 | if check_for_hash_alg "$hash_alg"; then |
| 479 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 480 | eval ${hash_alg_variable}=YES |
| 481 | fi |
| 482 | done |
| 483 | } |
| 484 | |
| 485 | # skip next test if the given hash alg is not supported |
| 486 | requires_hash_alg() { |
| 487 | HASH_DEFINE="Invalid" |
| 488 | HAS_HASH_ALG="NO" |
| 489 | case $1 in |
| 490 | SHA_1):;; |
| 491 | SHA_224):;; |
| 492 | SHA_256):;; |
| 493 | SHA_384):;; |
| 494 | SHA_512):;; |
| 495 | *) |
| 496 | echo "Unsupported hash alg - $1" |
| 497 | exit 1 |
| 498 | ;; |
| 499 | esac |
| 500 | |
| 501 | HASH_DEFINE=HAS_ALG_${1} |
| 502 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 503 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 504 | then |
| 505 | SKIP_NEXT="YES" |
| 506 | fi |
| 507 | } |
| 508 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 509 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 510 | requires_openssl_with_fallback_scsv() { |
| 511 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 512 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 513 | then |
| 514 | OPENSSL_HAS_FBSCSV="YES" |
| 515 | else |
| 516 | OPENSSL_HAS_FBSCSV="NO" |
| 517 | fi |
| 518 | fi |
| 519 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 520 | SKIP_NEXT="YES" |
| 521 | fi |
| 522 | } |
| 523 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 524 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 525 | requires_max_content_len() { |
| 526 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 527 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 528 | } |
| 529 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 530 | # skip next test if GnuTLS isn't available |
| 531 | requires_gnutls() { |
| 532 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 533 | 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] | 534 | GNUTLS_AVAILABLE="YES" |
| 535 | else |
| 536 | GNUTLS_AVAILABLE="NO" |
| 537 | fi |
| 538 | fi |
| 539 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 540 | SKIP_NEXT="YES" |
| 541 | fi |
| 542 | } |
| 543 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 544 | # skip next test if GnuTLS-next isn't available |
| 545 | requires_gnutls_next() { |
| 546 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 547 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 548 | GNUTLS_NEXT_AVAILABLE="YES" |
| 549 | else |
| 550 | GNUTLS_NEXT_AVAILABLE="NO" |
| 551 | fi |
| 552 | fi |
| 553 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 554 | SKIP_NEXT="YES" |
| 555 | fi |
| 556 | } |
| 557 | |
| 558 | # skip next test if OpenSSL-legacy isn't available |
| 559 | requires_openssl_legacy() { |
| 560 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 561 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 562 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 563 | else |
| 564 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 565 | fi |
| 566 | fi |
| 567 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 568 | SKIP_NEXT="YES" |
| 569 | fi |
| 570 | } |
| 571 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 572 | requires_openssl_next() { |
| 573 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 574 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 575 | OPENSSL_NEXT_AVAILABLE="YES" |
| 576 | else |
| 577 | OPENSSL_NEXT_AVAILABLE="NO" |
| 578 | fi |
| 579 | fi |
| 580 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 581 | SKIP_NEXT="YES" |
| 582 | fi |
| 583 | } |
| 584 | |
| 585 | # skip next test if tls1_3 is not available |
| 586 | requires_openssl_tls1_3() { |
| 587 | requires_openssl_next |
| 588 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 589 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 590 | fi |
| 591 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 592 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 593 | then |
| 594 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 595 | else |
| 596 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 597 | fi |
| 598 | fi |
| 599 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 600 | SKIP_NEXT="YES" |
| 601 | fi |
| 602 | } |
| 603 | |
| 604 | # skip next test if tls1_3 is not available |
| 605 | requires_gnutls_tls1_3() { |
| 606 | requires_gnutls_next |
| 607 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 608 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 609 | fi |
| 610 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 611 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 612 | then |
| 613 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 614 | else |
| 615 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 616 | fi |
| 617 | fi |
| 618 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 619 | SKIP_NEXT="YES" |
| 620 | fi |
| 621 | } |
| 622 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 623 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 624 | requires_gnutls_next_no_ticket() { |
| 625 | requires_gnutls_next |
| 626 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 627 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 628 | fi |
| 629 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 630 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 631 | then |
| 632 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 633 | else |
| 634 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 635 | fi |
| 636 | fi |
| 637 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 638 | SKIP_NEXT="YES" |
| 639 | fi |
| 640 | } |
| 641 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 642 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 643 | requires_gnutls_next_disable_tls13_compat() { |
| 644 | requires_gnutls_next |
| 645 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 646 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 647 | fi |
| 648 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 649 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 650 | then |
| 651 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 652 | else |
| 653 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 654 | fi |
| 655 | fi |
| 656 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 657 | SKIP_NEXT="YES" |
| 658 | fi |
| 659 | } |
| 660 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 661 | # skip next test if IPv6 isn't available on this host |
| 662 | requires_ipv6() { |
| 663 | if [ -z "${HAS_IPV6:-}" ]; then |
| 664 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 665 | SRV_PID=$! |
| 666 | sleep 1 |
| 667 | kill $SRV_PID >/dev/null 2>&1 |
| 668 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 669 | HAS_IPV6="NO" |
| 670 | else |
| 671 | HAS_IPV6="YES" |
| 672 | fi |
| 673 | rm -r $SRV_OUT |
| 674 | fi |
| 675 | |
| 676 | if [ "$HAS_IPV6" = "NO" ]; then |
| 677 | SKIP_NEXT="YES" |
| 678 | fi |
| 679 | } |
| 680 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 681 | # skip next test if it's i686 or uname is not available |
| 682 | requires_not_i686() { |
| 683 | if [ -z "${IS_I686:-}" ]; then |
| 684 | IS_I686="YES" |
| 685 | if which "uname" >/dev/null 2>&1; then |
| 686 | if [ -z "$(uname -a | grep i686)" ]; then |
| 687 | IS_I686="NO" |
| 688 | fi |
| 689 | fi |
| 690 | fi |
| 691 | if [ "$IS_I686" = "YES" ]; then |
| 692 | SKIP_NEXT="YES" |
| 693 | fi |
| 694 | } |
| 695 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 696 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 697 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 698 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 699 | 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] | 700 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 701 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 702 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 703 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 704 | fi |
| 705 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 706 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 707 | fi |
| 708 | |
| 709 | # skip the next test if the SSL output buffer is less than 16KB |
| 710 | requires_full_size_output_buffer() { |
| 711 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 712 | SKIP_NEXT="YES" |
| 713 | fi |
| 714 | } |
| 715 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 716 | # skip the next test if valgrind is in use |
| 717 | not_with_valgrind() { |
| 718 | if [ "$MEMCHECK" -gt 0 ]; then |
| 719 | SKIP_NEXT="YES" |
| 720 | fi |
| 721 | } |
| 722 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 723 | # skip the next test if valgrind is NOT in use |
| 724 | only_with_valgrind() { |
| 725 | if [ "$MEMCHECK" -eq 0 ]; then |
| 726 | SKIP_NEXT="YES" |
| 727 | fi |
| 728 | } |
| 729 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 730 | # 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] | 731 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 732 | CLI_DELAY_FACTOR=$1 |
| 733 | } |
| 734 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 735 | # wait for the given seconds after the client finished in the next test |
| 736 | server_needs_more_time() { |
| 737 | SRV_DELAY_SECONDS=$1 |
| 738 | } |
| 739 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 740 | # print_name <name> |
| 741 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 742 | TESTS=$(( $TESTS + 1 )) |
| 743 | LINE="" |
| 744 | |
| 745 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 746 | LINE="$TESTS " |
| 747 | fi |
| 748 | |
| 749 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 750 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 751 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 752 | for i in `seq 1 $LEN`; do printf '.'; done |
| 753 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 754 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 755 | } |
| 756 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 757 | # record_outcome <outcome> [<failure-reason>] |
| 758 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 759 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 760 | record_outcome() { |
| 761 | echo "$1" |
| 762 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 763 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 764 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 765 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 766 | "$1" "${2-}" \ |
| 767 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 768 | fi |
| 769 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 770 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 771 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 772 | # True if the presence of the given pattern in a log definitely indicates |
| 773 | # that the test has failed. False if the presence is inconclusive. |
| 774 | # |
| 775 | # Inputs: |
| 776 | # * $1: pattern found in the logs |
| 777 | # * $TIMES_LEFT: >0 if retrying is an option |
| 778 | # |
| 779 | # Outputs: |
| 780 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 781 | # unchanged otherwise. |
| 782 | # * Return value: 1 if the pattern is inconclusive, |
| 783 | # 0 if the failure is definitive. |
| 784 | log_pattern_presence_is_conclusive() { |
| 785 | # If we've run out of attempts, then don't retry no matter what. |
| 786 | if [ $TIMES_LEFT -eq 0 ]; then |
| 787 | return 0 |
| 788 | fi |
| 789 | case $1 in |
| 790 | "resend") |
| 791 | # An undesired resend may have been caused by the OS dropping or |
| 792 | # delaying a packet at an inopportune time. |
| 793 | outcome="RETRY(resend)" |
| 794 | return 1;; |
| 795 | esac |
| 796 | } |
| 797 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 798 | # fail <message> |
| 799 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 800 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 801 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 802 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 803 | mv $SRV_OUT o-srv-${TESTS}.log |
| 804 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 805 | if [ -n "$PXY_CMD" ]; then |
| 806 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 807 | fi |
| 808 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 809 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 810 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 811 | echo " ! server output:" |
| 812 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 813 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 814 | echo " ! client output:" |
| 815 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 816 | if [ -n "$PXY_CMD" ]; then |
| 817 | echo " ! ========================================================" |
| 818 | echo " ! proxy output:" |
| 819 | cat o-pxy-${TESTS}.log |
| 820 | fi |
| 821 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 822 | fi |
| 823 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 824 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 825 | } |
| 826 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 827 | # is_polar <cmd_line> |
| 828 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 829 | case "$1" in |
| 830 | *ssl_client2*) true;; |
| 831 | *ssl_server2*) true;; |
| 832 | *) false;; |
| 833 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 834 | } |
| 835 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 836 | # openssl s_server doesn't have -www with DTLS |
| 837 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 838 | case "$SRV_CMD" in |
| 839 | *s_server*-dtls*) |
| 840 | NEEDS_INPUT=1 |
| 841 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 842 | *) NEEDS_INPUT=0;; |
| 843 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | # provide input to commands that need it |
| 847 | provide_input() { |
| 848 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 849 | return |
| 850 | fi |
| 851 | |
| 852 | while true; do |
| 853 | echo "HTTP/1.0 200 OK" |
| 854 | sleep 1 |
| 855 | done |
| 856 | } |
| 857 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 858 | # has_mem_err <log_file_name> |
| 859 | has_mem_err() { |
| 860 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 861 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 862 | then |
| 863 | return 1 # false: does not have errors |
| 864 | else |
| 865 | return 0 # true: has errors |
| 866 | fi |
| 867 | } |
| 868 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 869 | # 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] | 870 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 871 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 872 | newline=' |
| 873 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 874 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 875 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 876 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 877 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 878 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 879 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 880 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 881 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 882 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 883 | # When we use a proxy, it will be listening on the same port we |
| 884 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 885 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 886 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 887 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 888 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 889 | echo "$3 START TIMEOUT" |
| 890 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 891 | break |
| 892 | fi |
| 893 | # Linux and *BSD support decimal arguments to sleep. On other |
| 894 | # OSes this may be a tight loop. |
| 895 | sleep 0.1 2>/dev/null || true |
| 896 | done |
| 897 | } |
| 898 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 899 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 900 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 901 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 902 | } |
| 903 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 904 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 905 | # Wait for server process $2 to be listening on port $1. |
| 906 | wait_server_start() { |
| 907 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 908 | } |
| 909 | |
| 910 | # Wait for proxy process $2 to be listening on port $1. |
| 911 | wait_proxy_start() { |
| 912 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 913 | } |
| 914 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 915 | # 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] | 916 | # 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] | 917 | # acceptable bounds |
| 918 | check_server_hello_time() { |
| 919 | # 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] | 920 | 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] | 921 | # Get the Unix timestamp for now |
| 922 | CUR_TIME=$(date +'%s') |
| 923 | THRESHOLD_IN_SECS=300 |
| 924 | |
| 925 | # Check if the ServerHello time was printed |
| 926 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 927 | return 1 |
| 928 | fi |
| 929 | |
| 930 | # Check the time in ServerHello is within acceptable bounds |
| 931 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 932 | # The time in ServerHello is at least 5 minutes before now |
| 933 | return 1 |
| 934 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 935 | # 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] | 936 | return 1 |
| 937 | else |
| 938 | return 0 |
| 939 | fi |
| 940 | } |
| 941 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 942 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 943 | handshake_memory_get() { |
| 944 | OUTPUT_VARIABLE="$1" |
| 945 | OUTPUT_FILE="$2" |
| 946 | |
| 947 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 948 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 949 | |
| 950 | # Check if memory usage was read |
| 951 | if [ -z "$MEM_USAGE" ]; then |
| 952 | echo "Error: Can not read the value of handshake memory usage" |
| 953 | return 1 |
| 954 | else |
| 955 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 956 | return 0 |
| 957 | fi |
| 958 | } |
| 959 | |
| 960 | # Get handshake memory usage from server or client output and check if this value |
| 961 | # is not higher than the maximum given by the first argument |
| 962 | handshake_memory_check() { |
| 963 | MAX_MEMORY="$1" |
| 964 | OUTPUT_FILE="$2" |
| 965 | |
| 966 | # Get memory usage |
| 967 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 968 | return 1 |
| 969 | fi |
| 970 | |
| 971 | # Check if memory usage is below max value |
| 972 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 973 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 974 | "but should be below $MAX_MEMORY bytes" |
| 975 | return 1 |
| 976 | else |
| 977 | return 0 |
| 978 | fi |
| 979 | } |
| 980 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 981 | # wait for client to terminate and set CLI_EXIT |
| 982 | # must be called right after starting the client |
| 983 | wait_client_done() { |
| 984 | CLI_PID=$! |
| 985 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 986 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 987 | CLI_DELAY_FACTOR=1 |
| 988 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 989 | ( 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] | 990 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 991 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 992 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 993 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 994 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 995 | CLI_EXIT=$? |
| 996 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 997 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 998 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 999 | |
| 1000 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1001 | |
| 1002 | sleep $SRV_DELAY_SECONDS |
| 1003 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1004 | } |
| 1005 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1006 | # check if the given command uses dtls and sets global variable DTLS |
| 1007 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1008 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1009 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1010 | *) DTLS=0;; |
| 1011 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1012 | } |
| 1013 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1014 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1015 | is_gnutls() { |
| 1016 | case "$1" in |
| 1017 | *gnutls-cli*) |
| 1018 | CMD_IS_GNUTLS=1 |
| 1019 | ;; |
| 1020 | *gnutls-serv*) |
| 1021 | CMD_IS_GNUTLS=1 |
| 1022 | ;; |
| 1023 | *) |
| 1024 | CMD_IS_GNUTLS=0 |
| 1025 | ;; |
| 1026 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1027 | } |
| 1028 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1029 | # Generate random psk_list argument for ssl_server2 |
| 1030 | get_srv_psk_list () |
| 1031 | { |
| 1032 | case $(( TESTS % 3 )) in |
| 1033 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1034 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1035 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1036 | esac |
| 1037 | } |
| 1038 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1039 | # Determine what calc_verify trace is to be expected, if any. |
| 1040 | # |
| 1041 | # calc_verify is only called for two things: to calculate the |
| 1042 | # extended master secret, and to process client authentication. |
| 1043 | # |
| 1044 | # Warning: the current implementation assumes that extended_ms is not |
| 1045 | # disabled on the client or on the server. |
| 1046 | # |
| 1047 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1048 | # * $1: the value of the server auth_mode parameter. |
| 1049 | # 'required' if client authentication is expected, |
| 1050 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1051 | # * $CONFIGS_ENABLED |
| 1052 | # |
| 1053 | # Outputs: |
| 1054 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1055 | set_maybe_calc_verify() { |
| 1056 | maybe_calc_verify= |
| 1057 | case $CONFIGS_ENABLED in |
| 1058 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1059 | *) |
| 1060 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1061 | ''|none) return;; |
| 1062 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1063 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1064 | esac |
| 1065 | esac |
| 1066 | case $CONFIGS_ENABLED in |
| 1067 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1068 | *) maybe_calc_verify="<= calc verify";; |
| 1069 | esac |
| 1070 | } |
| 1071 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1072 | # Compare file content |
| 1073 | # Usage: find_in_both pattern file1 file2 |
| 1074 | # extract from file1 the first line matching the pattern |
| 1075 | # check in file2 that the same line can be found |
| 1076 | find_in_both() { |
| 1077 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1078 | if [ -z "$srv_pattern" ]; then |
| 1079 | return 1; |
| 1080 | fi |
| 1081 | |
| 1082 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1083 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1084 | else |
| 1085 | return 1; |
| 1086 | fi |
| 1087 | } |
| 1088 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1089 | SKIP_HANDSHAKE_CHECK="NO" |
| 1090 | skip_handshake_stage_check() { |
| 1091 | SKIP_HANDSHAKE_CHECK="YES" |
| 1092 | } |
| 1093 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1094 | # Analyze the commands that will be used in a test. |
| 1095 | # |
| 1096 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1097 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1098 | # |
| 1099 | # Inputs: |
| 1100 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1101 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1102 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1103 | # |
| 1104 | # Outputs: |
| 1105 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1106 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1107 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1108 | # 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] | 1109 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1110 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1111 | case " $SRV_CMD " in |
| 1112 | *' server_addr=::1 '*) |
| 1113 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1114 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1115 | fi |
| 1116 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1117 | # update CMD_IS_GNUTLS variable |
| 1118 | is_gnutls "$SRV_CMD" |
| 1119 | |
| 1120 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1121 | # set the default priority |
| 1122 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1123 | case "$SRV_CMD" in |
| 1124 | *--priority*) :;; |
| 1125 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1126 | esac |
| 1127 | fi |
| 1128 | |
| 1129 | # update CMD_IS_GNUTLS variable |
| 1130 | is_gnutls "$CLI_CMD" |
| 1131 | |
| 1132 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1133 | # set the default priority |
| 1134 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1135 | case "$CLI_CMD" in |
| 1136 | *--priority*) :;; |
| 1137 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1138 | esac |
| 1139 | fi |
| 1140 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1141 | # fix client port |
| 1142 | if [ -n "$PXY_CMD" ]; then |
| 1143 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1144 | else |
| 1145 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1146 | fi |
| 1147 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1148 | # prepend valgrind to our commands if active |
| 1149 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1150 | if is_polar "$SRV_CMD"; then |
| 1151 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1152 | fi |
| 1153 | if is_polar "$CLI_CMD"; then |
| 1154 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1155 | fi |
| 1156 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1157 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1158 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1159 | # Check for failure conditions after a test case. |
| 1160 | # |
| 1161 | # Inputs from run_test: |
| 1162 | # * positional parameters: test options (see run_test documentation) |
| 1163 | # * $CLI_EXIT: client return code |
| 1164 | # * $CLI_EXPECT: expected client return code |
| 1165 | # * $SRV_RET: server return code |
| 1166 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1167 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1168 | # |
| 1169 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1170 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1171 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1172 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1173 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1174 | if [ $TIMES_LEFT -gt 0 ] && |
| 1175 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1176 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1177 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1178 | return |
| 1179 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1180 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1181 | # 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] | 1182 | # (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] | 1183 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1184 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1185 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1186 | then |
| 1187 | if is_polar "$SRV_CMD"; then |
| 1188 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1189 | else |
| 1190 | fail "server or client failed to reach handshake stage" |
| 1191 | return |
| 1192 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1193 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1194 | if is_polar "$CLI_CMD"; then |
| 1195 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1196 | else |
| 1197 | fail "server or client failed to reach handshake stage" |
| 1198 | return |
| 1199 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1200 | fi |
| 1201 | fi |
| 1202 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1203 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1204 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1205 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1206 | # care anyway), in case e.g. the server reports a memory leak. |
| 1207 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1208 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1209 | return |
| 1210 | fi |
| 1211 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1212 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1213 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1214 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1215 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1216 | 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] | 1217 | return |
| 1218 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1219 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1220 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1221 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1222 | # 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] | 1223 | while [ $# -gt 0 ] |
| 1224 | do |
| 1225 | case $1 in |
| 1226 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1227 | 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] | 1228 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1229 | return |
| 1230 | fi |
| 1231 | ;; |
| 1232 | |
| 1233 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1234 | 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] | 1235 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1236 | return |
| 1237 | fi |
| 1238 | ;; |
| 1239 | |
| 1240 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1241 | 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] | 1242 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1243 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1244 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1245 | return |
| 1246 | fi |
| 1247 | ;; |
| 1248 | |
| 1249 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1250 | 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] | 1251 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1252 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1253 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1254 | return |
| 1255 | fi |
| 1256 | ;; |
| 1257 | |
| 1258 | # The filtering in the following two options (-u and -U) do the following |
| 1259 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1260 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1261 | # - keep one of each non-unique line |
| 1262 | # - count how many lines remain |
| 1263 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1264 | # if there were no duplicates. |
| 1265 | "-U") |
| 1266 | 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 |
| 1267 | fail "lines following pattern '$2' must be unique in Server output" |
| 1268 | return |
| 1269 | fi |
| 1270 | ;; |
| 1271 | |
| 1272 | "-u") |
| 1273 | 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 |
| 1274 | 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] | 1275 | return |
| 1276 | fi |
| 1277 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1278 | "-F") |
| 1279 | if ! $2 "$SRV_OUT"; then |
| 1280 | fail "function call to '$2' failed on Server output" |
| 1281 | return |
| 1282 | fi |
| 1283 | ;; |
| 1284 | "-f") |
| 1285 | if ! $2 "$CLI_OUT"; then |
| 1286 | fail "function call to '$2' failed on Client output" |
| 1287 | return |
| 1288 | fi |
| 1289 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1290 | "-g") |
| 1291 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1292 | fail "function call to '$2' failed on Server and Client output" |
| 1293 | return |
| 1294 | fi |
| 1295 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1296 | |
| 1297 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1298 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1299 | exit 1 |
| 1300 | esac |
| 1301 | shift 2 |
| 1302 | done |
| 1303 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1304 | # check valgrind's results |
| 1305 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1306 | 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] | 1307 | fail "Server has memory errors" |
| 1308 | return |
| 1309 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1310 | 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] | 1311 | fail "Client has memory errors" |
| 1312 | return |
| 1313 | fi |
| 1314 | fi |
| 1315 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1316 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1317 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1318 | } |
| 1319 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1320 | # Run the current test case: start the server and if applicable the proxy, run |
| 1321 | # the client, wait for all processes to finish or time out. |
| 1322 | # |
| 1323 | # Inputs: |
| 1324 | # * $NAME: test case name |
| 1325 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1326 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1327 | # |
| 1328 | # Outputs: |
| 1329 | # * $CLI_EXIT: client return code |
| 1330 | # * $SRV_RET: server return code |
| 1331 | do_run_test_once() { |
| 1332 | # run the commands |
| 1333 | if [ -n "$PXY_CMD" ]; then |
| 1334 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1335 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1336 | PXY_PID=$! |
| 1337 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1338 | fi |
| 1339 | |
| 1340 | check_osrv_dtls |
| 1341 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1342 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1343 | SRV_PID=$! |
| 1344 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1345 | |
| 1346 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1347 | # The client must be a subprocess of the script in order for killing it to |
| 1348 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1349 | # not at the end of the line: the latter approach will spawn eval as a |
| 1350 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1351 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1352 | wait_client_done |
| 1353 | |
| 1354 | sleep 0.05 |
| 1355 | |
| 1356 | # terminate the server (and the proxy) |
| 1357 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1358 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1359 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1360 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1361 | SRV_RET=$? |
| 1362 | |
| 1363 | if [ -n "$PXY_CMD" ]; then |
| 1364 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1365 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1366 | fi |
| 1367 | } |
| 1368 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1369 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1370 | # Options: -s pattern pattern that must be present in server output |
| 1371 | # -c pattern pattern that must be present in client output |
| 1372 | # -u pattern lines after pattern must be unique in client output |
| 1373 | # -f call shell function on client output |
| 1374 | # -S pattern pattern that must be absent in server output |
| 1375 | # -C pattern pattern that must be absent in client output |
| 1376 | # -U pattern lines after pattern must be unique in server output |
| 1377 | # -F call shell function on server output |
| 1378 | # -g call shell function on server and client output |
| 1379 | run_test() { |
| 1380 | NAME="$1" |
| 1381 | shift 1 |
| 1382 | |
| 1383 | if is_excluded "$NAME"; then |
| 1384 | SKIP_NEXT="NO" |
| 1385 | # There was no request to run the test, so don't record its outcome. |
| 1386 | return |
| 1387 | fi |
| 1388 | |
| 1389 | print_name "$NAME" |
| 1390 | |
| 1391 | # Do we only run numbered tests? |
| 1392 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1393 | case ",$RUN_TEST_NUMBER," in |
| 1394 | *",$TESTS,"*) :;; |
| 1395 | *) SKIP_NEXT="YES";; |
| 1396 | esac |
| 1397 | fi |
| 1398 | |
| 1399 | # does this test use a proxy? |
| 1400 | if [ "X$1" = "X-p" ]; then |
| 1401 | PXY_CMD="$2" |
| 1402 | shift 2 |
| 1403 | else |
| 1404 | PXY_CMD="" |
| 1405 | fi |
| 1406 | |
| 1407 | # get commands and client output |
| 1408 | SRV_CMD="$1" |
| 1409 | CLI_CMD="$2" |
| 1410 | CLI_EXPECT="$3" |
| 1411 | shift 3 |
| 1412 | |
| 1413 | # Check if test uses files |
| 1414 | case "$SRV_CMD $CLI_CMD" in |
| 1415 | *data_files/*) |
| 1416 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1417 | esac |
| 1418 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1419 | # Check if the test uses DTLS. |
| 1420 | detect_dtls "$SRV_CMD" |
| 1421 | if [ "$DTLS" -eq 1 ]; then |
| 1422 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1423 | fi |
| 1424 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1425 | # If the client or server requires certain features that can be detected |
| 1426 | # from their command-line arguments, check that they're enabled. |
| 1427 | detect_required_features "$SRV_CMD" "$@" |
| 1428 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1429 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1430 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1431 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1432 | |
| 1433 | # should we skip? |
| 1434 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1435 | SKIP_NEXT="NO" |
| 1436 | record_outcome "SKIP" |
| 1437 | SKIPS=$(( $SKIPS + 1 )) |
| 1438 | return |
| 1439 | fi |
| 1440 | |
| 1441 | analyze_test_commands "$@" |
| 1442 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1443 | # One regular run and two retries |
| 1444 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1445 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1446 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1447 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1448 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1449 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1450 | check_test_failure "$@" |
| 1451 | case $outcome in |
| 1452 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1453 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1454 | FAIL) return;; |
| 1455 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1456 | done |
| 1457 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1458 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1459 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1460 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1461 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1462 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1463 | if [ -n "$PXY_CMD" ]; then |
| 1464 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1465 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1466 | fi |
| 1467 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1468 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1469 | } |
| 1470 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1471 | run_test_psa() { |
| 1472 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1473 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1474 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1475 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1476 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1477 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1478 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1479 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1480 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1481 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1482 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1483 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1484 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1485 | -S "error" \ |
| 1486 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1487 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1488 | } |
| 1489 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1490 | run_test_psa_force_curve() { |
| 1491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1492 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1493 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1494 | "$P_SRV debug_level=4 force_version=tls12 curves=$1" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1495 | "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1496 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1497 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1498 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1499 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1500 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1501 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1502 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1503 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1504 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1505 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1506 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1507 | } |
| 1508 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1509 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1510 | # a maximum fragment length. |
| 1511 | # first argument ($1) is MFL for SSL client |
| 1512 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1513 | run_test_memory_after_hanshake_with_mfl() |
| 1514 | { |
| 1515 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1516 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1517 | |
| 1518 | # Leave some margin for robustness |
| 1519 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1520 | |
| 1521 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1522 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1523 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1524 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1525 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1526 | 0 \ |
| 1527 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1528 | } |
| 1529 | |
| 1530 | |
| 1531 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1532 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1533 | run_tests_memory_after_hanshake() |
| 1534 | { |
| 1535 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1536 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1537 | |
| 1538 | # first test with default MFU is to get reference memory usage |
| 1539 | MEMORY_USAGE_MFL_16K=0 |
| 1540 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1541 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1542 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1543 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1544 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1545 | 0 \ |
| 1546 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1547 | |
| 1548 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1549 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1550 | |
| 1551 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1552 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1553 | |
| 1554 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1555 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1556 | |
| 1557 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1558 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1559 | } |
| 1560 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1561 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1562 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1563 | rm -f context_srv.txt |
| 1564 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1565 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1566 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1567 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1568 | 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] | 1569 | exit 1 |
| 1570 | } |
| 1571 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1572 | # |
| 1573 | # MAIN |
| 1574 | # |
| 1575 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1576 | get_options "$@" |
| 1577 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1578 | populate_enabled_hash_algs |
| 1579 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1580 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1581 | # patterns rather than regular expressions, use a case statement instead |
| 1582 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1583 | # detects simple cases: plain substring, everything, nothing. |
| 1584 | # |
| 1585 | # As an exception, the character '.' is treated as an ordinary character |
| 1586 | # if it is the only special character in the string. This is because it's |
| 1587 | # rare to need "any one character", but needing a literal '.' is common |
| 1588 | # (e.g. '-f "DTLS 1.2"'). |
| 1589 | need_grep= |
| 1590 | case "$FILTER" in |
| 1591 | '^$') simple_filter=;; |
| 1592 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1593 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1594 | need_grep=1;; |
| 1595 | *) # No regexp or shell-pattern special character |
| 1596 | simple_filter="*$FILTER*";; |
| 1597 | esac |
| 1598 | case "$EXCLUDE" in |
| 1599 | '^$') simple_exclude=;; |
| 1600 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1601 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1602 | need_grep=1;; |
| 1603 | *) # No regexp or shell-pattern special character |
| 1604 | simple_exclude="*$EXCLUDE*";; |
| 1605 | esac |
| 1606 | if [ -n "$need_grep" ]; then |
| 1607 | is_excluded () { |
| 1608 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1609 | } |
| 1610 | else |
| 1611 | is_excluded () { |
| 1612 | case "$1" in |
| 1613 | $simple_exclude) true;; |
| 1614 | $simple_filter) false;; |
| 1615 | *) true;; |
| 1616 | esac |
| 1617 | } |
| 1618 | fi |
| 1619 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1620 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1621 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1622 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1623 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1624 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1625 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1626 | exit 1 |
| 1627 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1628 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1629 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1630 | exit 1 |
| 1631 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1632 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1633 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1634 | exit 1 |
| 1635 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1636 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1637 | if which valgrind >/dev/null 2>&1; then :; else |
| 1638 | echo "Memcheck not possible. Valgrind not found" |
| 1639 | exit 1 |
| 1640 | fi |
| 1641 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1642 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1643 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1644 | exit 1 |
| 1645 | fi |
| 1646 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1647 | # used by watchdog |
| 1648 | MAIN_PID="$$" |
| 1649 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1650 | # We use somewhat arbitrary delays for tests: |
| 1651 | # - how long do we wait for the server to start (when lsof not available)? |
| 1652 | # - how long do we allow for the client to finish? |
| 1653 | # (not to check performance, just to avoid waiting indefinitely) |
| 1654 | # Things are slower with valgrind, so give extra time here. |
| 1655 | # |
| 1656 | # Note: without lsof, there is a trade-off between the running time of this |
| 1657 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1658 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1659 | # 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] | 1660 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1661 | START_DELAY=6 |
| 1662 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1663 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1664 | START_DELAY=2 |
| 1665 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1666 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1667 | |
| 1668 | # some particular tests need more time: |
| 1669 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1670 | # - for the server, we sleep for a number of seconds after the client exits |
| 1671 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1672 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1673 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1674 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1675 | # 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] | 1676 | # +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] | 1677 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1678 | # 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] | 1679 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1680 | 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] | 1681 | 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] | 1682 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1683 | 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] | 1684 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1685 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1686 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1687 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1688 | 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] | 1689 | 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] | 1690 | fi |
| 1691 | |
Gilles Peskine | 4bdb9fb | 2022-11-24 22:21:15 +0100 | [diff] [blame] | 1692 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1693 | # low-security ones. This covers not just cipher suites but also protocol |
| 1694 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1695 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1696 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1697 | # a way to discover it from -help, so check the openssl version. |
| 1698 | case $($OPENSSL_CMD version) in |
| 1699 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1700 | *) |
| 1701 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1702 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1703 | ;; |
| 1704 | esac |
| 1705 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1706 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1707 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1708 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 1709 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1710 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 1711 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1712 | fi |
| 1713 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1714 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1715 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 1716 | 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] | 1717 | fi |
| 1718 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1719 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1720 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Jerry Yu | b7c12a4 | 2022-06-12 20:53:02 +0800 | [diff] [blame] | 1721 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1722 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1723 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1724 | # Allow SHA-1, because many of our test certificates use it |
| 1725 | P_SRV="$P_SRV allow_sha1=1" |
| 1726 | P_CLI="$P_CLI allow_sha1=1" |
| 1727 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1728 | # Also pick a unique name for intermediate files |
| 1729 | SRV_OUT="srv_out.$$" |
| 1730 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1731 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1732 | SESSION="session.$$" |
| 1733 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1734 | SKIP_NEXT="NO" |
| 1735 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1736 | trap cleanup INT TERM HUP |
| 1737 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1738 | # Basic test |
| 1739 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1740 | # Checks that: |
| 1741 | # - 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] | 1742 | # - the expected parameters are selected |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1744 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1745 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Gilles Peskine | 1438e16 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_ECP_DP_CURVE25519_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1747 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1748 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1749 | "$P_CLI" \ |
| 1750 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1751 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1752 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1753 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1754 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1755 | -S "error" \ |
| 1756 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1757 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1758 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1759 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1760 | run_test "Default, DTLS" \ |
| 1761 | "$P_SRV dtls=1" \ |
| 1762 | "$P_CLI dtls=1" \ |
| 1763 | 0 \ |
| 1764 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1765 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1768 | run_test "TLS client auth: required" \ |
| 1769 | "$P_SRV auth_mode=required" \ |
| 1770 | "$P_CLI" \ |
| 1771 | 0 \ |
| 1772 | -s "Verifying peer X.509 certificate... ok" |
| 1773 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1775 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1776 | "$P_SRV" \ |
| 1777 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1778 | 0 \ |
| 1779 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1780 | -c "Key size is 256" |
| 1781 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 1783 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1784 | "$P_SRV" \ |
| 1785 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1786 | 0 \ |
| 1787 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1788 | -c "Key size is 128" |
| 1789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1791 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1792 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1793 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1794 | run_test "TLS: password protected client key" \ |
| 1795 | "$P_SRV auth_mode=required" \ |
| 1796 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1797 | 0 |
| 1798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1801 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1802 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1803 | run_test "TLS: password protected server key" \ |
| 1804 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1805 | "$P_CLI" \ |
| 1806 | 0 |
| 1807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1809 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1810 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1811 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1812 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1813 | run_test "TLS: password protected server key, two certificates" \ |
| 1814 | "$P_SRV \ |
| 1815 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1816 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1817 | "$P_CLI" \ |
| 1818 | 0 |
| 1819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1822 | run_test "CA callback on client" \ |
| 1823 | "$P_SRV debug_level=3" \ |
| 1824 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1825 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1826 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1827 | -S "error" \ |
| 1828 | -C "error" |
| 1829 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1832 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1833 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1834 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1835 | run_test "CA callback on server" \ |
| 1836 | "$P_SRV auth_mode=required" \ |
| 1837 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1838 | key_file=data_files/server5.key" \ |
| 1839 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1840 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1841 | -s "Verifying peer X.509 certificate... ok" \ |
| 1842 | -S "error" \ |
| 1843 | -C "error" |
| 1844 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1845 | # Test using an EC opaque private key for client authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1848 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1849 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1850 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1851 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1852 | "$P_SRV auth_mode=required crt_file=data_files/server5.crt \ |
| 1853 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1854 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1855 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1856 | 0 \ |
| 1857 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1858 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1859 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1860 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1861 | -S "error" \ |
| 1862 | -C "error" |
| 1863 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1864 | # Test using a RSA opaque private key for client authentication |
| 1865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1867 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1868 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1869 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1870 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1871 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1872 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1873 | key_file=data_files/server2.key" \ |
| 1874 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1875 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1876 | 0 \ |
| 1877 | -c "key type: Opaque" \ |
| 1878 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1879 | -s "Verifying peer X.509 certificate... ok" \ |
| 1880 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 1881 | -S "error" \ |
| 1882 | -C "error" |
| 1883 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1884 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1886 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1887 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1888 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1889 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1890 | "$P_SRV auth_mode=required crt_file=data_files/server2-sha256.crt \ |
| 1891 | key_file=data_files/server2.key" \ |
| 1892 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1893 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 1894 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 1895 | 0 \ |
| 1896 | -c "key type: Opaque" \ |
| 1897 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 1898 | -s "Verifying peer X.509 certificate... ok" \ |
| 1899 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 1900 | -S "error" \ |
| 1901 | -C "error" |
| 1902 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 1903 | # Test using an EC opaque private key for server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1906 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1907 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1908 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1909 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1910 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1911 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1912 | "$P_CLI" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1913 | 0 \ |
| 1914 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1915 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 1916 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 1917 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 1918 | -S "error" \ |
| 1919 | -C "error" |
| 1920 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1923 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1924 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1925 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1926 | run_test "Opaque key for server authentication: ECDH-" \ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 1927 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1\ |
| 1928 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1929 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 1930 | "$P_CLI" \ |
| 1931 | 0 \ |
| 1932 | -c "Verifying peer X.509 certificate... ok" \ |
| 1933 | -c "Ciphersuite is TLS-ECDH-" \ |
| 1934 | -s "key types: Opaque, none" \ |
| 1935 | -s "Ciphersuite is TLS-ECDH-" \ |
| 1936 | -S "error" \ |
| 1937 | -C "error" |
| 1938 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 1939 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1940 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1941 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1942 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1943 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1944 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1945 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 1946 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 1947 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1948 | debug_level=1" \ |
| 1949 | "$P_CLI" \ |
| 1950 | 1 \ |
| 1951 | -s "key types: Opaque, none" \ |
| 1952 | -s "error" \ |
| 1953 | -c "error" \ |
| 1954 | -c "Public key type mismatch" |
| 1955 | |
| 1956 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1957 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1958 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1959 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1960 | requires_config_enabled MBEDTLS_RSA_C |
| 1961 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1962 | requires_hash_alg SHA_256 |
| 1963 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 1964 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 1965 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 1966 | debug_level=1" \ |
| 1967 | "$P_CLI" \ |
| 1968 | 1 \ |
| 1969 | -s "key types: Opaque, none" \ |
| 1970 | -s "error" \ |
| 1971 | -c "error" \ |
| 1972 | -c "Public key type mismatch" |
| 1973 | |
| 1974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1975 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1976 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1977 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1978 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 1979 | requires_hash_alg SHA_256 |
| 1980 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1981 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1982 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 1983 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1984 | "$P_CLI" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 1985 | 1 \ |
| 1986 | -s "key types: Opaque, none" \ |
| 1987 | -s "got ciphersuites in common, but none of them usable" \ |
| 1988 | -s "error" \ |
| 1989 | -c "error" |
| 1990 | |
| 1991 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 1992 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1993 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1994 | requires_config_enabled MBEDTLS_ECDSA_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 1995 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1996 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1997 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 1998 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 1999 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2000 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2001 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2002 | "$P_CLI" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2003 | 1 \ |
| 2004 | -s "key types: Opaque, none" \ |
| 2005 | -s "got ciphersuites in common, but none of them usable" \ |
| 2006 | -s "error" \ |
| 2007 | -c "error" |
| 2008 | |
| 2009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2010 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2011 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2012 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2013 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2015 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2016 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2017 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2018 | debug_level=1" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2019 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2020 | 1 \ |
| 2021 | -s "key types: Opaque, none" \ |
| 2022 | -s "got ciphersuites in common, but none of them usable" \ |
| 2023 | -s "error" \ |
| 2024 | -c "error" |
| 2025 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2027 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2028 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2029 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2030 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2031 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2032 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2033 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2034 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2035 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2036 | key_opaque_algs2=ecdsa-sign,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2037 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2038 | 0 \ |
| 2039 | -c "Verifying peer X.509 certificate... ok" \ |
| 2040 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2041 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2042 | -s "key types: Opaque, Opaque" \ |
| 2043 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2044 | -S "error" \ |
| 2045 | -C "error" |
| 2046 | |
| 2047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2048 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2049 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2050 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2051 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2052 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2053 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2054 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2055 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2056 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2057 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2058 | "$P_CLI force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2059 | 0 \ |
| 2060 | -c "Verifying peer X.509 certificate... ok" \ |
| 2061 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2062 | -c "CN=Polarssl Test EC CA" \ |
| 2063 | -s "key types: Opaque, Opaque" \ |
| 2064 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2065 | -S "error" \ |
| 2066 | -C "error" |
| 2067 | |
| 2068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2069 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2070 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2071 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2072 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2074 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2075 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2076 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2077 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2078 | crt_file2=data_files/server2-sha256.crt \ |
| 2079 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2080 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2081 | 0 \ |
| 2082 | -c "Verifying peer X.509 certificate... ok" \ |
| 2083 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2084 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2085 | -s "key types: Opaque, Opaque" \ |
| 2086 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2087 | -S "error" \ |
| 2088 | -C "error" |
| 2089 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2091 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2092 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame^] | 2093 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2094 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2095 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2096 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2097 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2098 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2099 | -s "The SSL configuration is tls13 only" \ |
| 2100 | -c "key type: Opaque" \ |
| 2101 | -s "key types: Opaque, Opaque" \ |
| 2102 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2103 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2104 | |
| 2105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2106 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2107 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame^] | 2108 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2109 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2110 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2111 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2112 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2113 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2114 | -s "The SSL configuration is tls13 only" \ |
| 2115 | -c "key type: Opaque" \ |
| 2116 | -s "key types: Opaque, Opaque" \ |
| 2117 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame^] | 2118 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2119 | |
| 2120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2121 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2122 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame^] | 2123 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2124 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2125 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
| 2126 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
| 2127 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2128 | 0 \ |
| 2129 | -s "The SSL configuration is tls13 only" \ |
| 2130 | -s "key types: Opaque, Opaque" \ |
| 2131 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2132 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2133 | -C "error" \ |
| 2134 | -S "error" \ |
| 2135 | |
| 2136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2137 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2138 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame^] | 2139 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2140 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2141 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 277cdcb | 2022-09-16 16:57:20 +0200 | [diff] [blame] | 2142 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2143 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2144 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2145 | -s "The SSL configuration is tls13 only" \ |
| 2146 | -c "key type: Opaque" \ |
| 2147 | -s "key types: Opaque, Opaque" \ |
| 2148 | -C "error" \ |
| 2149 | -S "error" \ |
| 2150 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2151 | # Test using a RSA opaque private key for server authentication |
| 2152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2153 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2154 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2155 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2156 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2157 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2158 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2159 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2160 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2161 | "$P_CLI" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2162 | 0 \ |
| 2163 | -c "Verifying peer X.509 certificate... ok" \ |
| 2164 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2165 | -s "key types: Opaque, none" \ |
| 2166 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2167 | -S "error" \ |
| 2168 | -C "error" |
| 2169 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2171 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2172 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2173 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2174 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2175 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2176 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2177 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2178 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2179 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2180 | 0 \ |
| 2181 | -c "Verifying peer X.509 certificate... ok" \ |
| 2182 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2183 | -s "key types: Opaque, none" \ |
| 2184 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2185 | -S "error" \ |
| 2186 | -C "error" |
| 2187 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2189 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2190 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2191 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2192 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2193 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2194 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2195 | psk=abc123 psk_identity=foo" \ |
| 2196 | "$P_CLI force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 2197 | psk=abc123 psk_identity=foo" \ |
| 2198 | 0 \ |
| 2199 | -c "Verifying peer X.509 certificate... ok" \ |
| 2200 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2201 | -s "key types: Opaque, Opaque" \ |
| 2202 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2203 | -S "error" \ |
| 2204 | -C "error" |
| 2205 | |
| 2206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2207 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2208 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2209 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2210 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2211 | run_test "Opaque key for server authentication: RSA-" \ |
| 2212 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
| 2213 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
| 2214 | 0 \ |
| 2215 | -c "Verifying peer X.509 certificate... ok" \ |
| 2216 | -c "Ciphersuite is TLS-RSA-" \ |
| 2217 | -s "key types: Opaque, Opaque" \ |
| 2218 | -s "Ciphersuite is TLS-RSA-" \ |
| 2219 | -S "error" \ |
| 2220 | -C "error" |
| 2221 | |
| 2222 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2223 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2224 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2225 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2226 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2227 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2228 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2229 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2230 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2231 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2232 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2233 | 1 \ |
| 2234 | -s "key types: Opaque, none" \ |
| 2235 | -s "got ciphersuites in common, but none of them usable" \ |
| 2236 | -s "error" \ |
| 2237 | -c "error" |
| 2238 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2240 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2241 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2242 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2243 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2244 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2245 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2246 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2247 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2248 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2249 | crt_file2=data_files/server4.crt \ |
| 2250 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2251 | "$P_CLI" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2252 | 0 \ |
| 2253 | -c "Verifying peer X.509 certificate... ok" \ |
| 2254 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2255 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2256 | -s "key types: Opaque, Opaque" \ |
| 2257 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2258 | -S "error" \ |
| 2259 | -C "error" |
| 2260 | |
| 2261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2262 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2263 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2264 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2265 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2266 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2268 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2269 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2270 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2271 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2272 | crt_file2=data_files/server4.crt \ |
| 2273 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2274 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2275 | 0 \ |
| 2276 | -c "Verifying peer X.509 certificate... ok" \ |
| 2277 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2278 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2279 | -s "key types: Opaque, Opaque" \ |
| 2280 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2281 | -S "error" \ |
| 2282 | -C "error" |
| 2283 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2284 | # Test using an EC opaque private key for client/server authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2286 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2287 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2288 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2289 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2290 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2291 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2292 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2293 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2294 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2295 | 0 \ |
| 2296 | -c "key type: Opaque" \ |
| 2297 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2298 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2299 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2300 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2301 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2302 | -S "error" \ |
| 2303 | -C "error" |
| 2304 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2305 | # Test using a RSA opaque private key for client/server authentication |
| 2306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2307 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2308 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2309 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2310 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2311 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2312 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2313 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2314 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2315 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2316 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2317 | 0 \ |
| 2318 | -c "key type: Opaque" \ |
| 2319 | -c "Verifying peer X.509 certificate... ok" \ |
| 2320 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2321 | -s "key types: Opaque, none" \ |
| 2322 | -s "Verifying peer X.509 certificate... ok" \ |
| 2323 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2324 | -S "error" \ |
| 2325 | -C "error" |
| 2326 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2329 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2330 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2331 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2332 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2333 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2334 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2335 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2336 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2337 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2338 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2339 | 0 \ |
| 2340 | -c "key type: Opaque" \ |
| 2341 | -c "Verifying peer X.509 certificate... ok" \ |
| 2342 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2343 | -s "key types: Opaque, none" \ |
| 2344 | -s "Verifying peer X.509 certificate... ok" \ |
| 2345 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2346 | -S "error" \ |
| 2347 | -C "error" |
| 2348 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2349 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2350 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2351 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2352 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2353 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2354 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2355 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2356 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2357 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2358 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2359 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2360 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2361 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 2363 | run_test_psa_force_curve "secp521r1" |
| 2364 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 2365 | run_test_psa_force_curve "brainpoolP512r1" |
| 2366 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 2367 | run_test_psa_force_curve "secp384r1" |
| 2368 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 2369 | run_test_psa_force_curve "brainpoolP384r1" |
| 2370 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2371 | run_test_psa_force_curve "secp256r1" |
| 2372 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 2373 | run_test_psa_force_curve "secp256k1" |
| 2374 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 2375 | run_test_psa_force_curve "brainpoolP256r1" |
| 2376 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 2377 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2378 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2379 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2380 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2381 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2382 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 2383 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 2384 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2385 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 2386 | run_test_psa_force_curve "secp192r1" |
| 2387 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 2388 | run_test_psa_force_curve "secp192k1" |
| 2389 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2390 | # Test current time in ServerHello |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2393 | run_test "ServerHello contains gmt_unix_time" \ |
| 2394 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2395 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2396 | 0 \ |
| 2397 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2398 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2399 | |
| 2400 | # Test for uniqueness of IVs in AEAD ciphersuites |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2401 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2402 | run_test "Unique IV in GCM" \ |
| 2403 | "$P_SRV exchanges=20 debug_level=4" \ |
| 2404 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2405 | 0 \ |
| 2406 | -u "IV used" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2407 | -U "IV used" |
| 2408 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2409 | # Test for correctness of sent single supported algorithm |
| 2410 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2412 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2413 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2414 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2416 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2417 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2418 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2419 | "$P_CLI sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
| 2420 | 0 \ |
| 2421 | -c "Supported Signature Algorithm found: 04 03" |
| 2422 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2424 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2425 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2426 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 2427 | requires_hash_alg SHA_256 |
| 2428 | run_test "Single supported algorithm sending: openssl client" \ |
| 2429 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2430 | "$O_CLI -cert data_files/server6.crt \ |
| 2431 | -key data_files/server6.key" \ |
| 2432 | 0 |
| 2433 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2434 | # Tests for certificate verification callback |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2436 | run_test "Configuration-specific CRT verification callback" \ |
| 2437 | "$P_SRV debug_level=3" \ |
| 2438 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 2439 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2440 | -S "error" \ |
| 2441 | -c "Verify requested for " \ |
| 2442 | -c "Use configuration-specific verification callback" \ |
| 2443 | -C "Use context-specific verification callback" \ |
| 2444 | -C "error" |
| 2445 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2447 | run_test "Context-specific CRT verification callback" \ |
| 2448 | "$P_SRV debug_level=3" \ |
| 2449 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 2450 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2451 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2452 | -c "Verify requested for " \ |
| 2453 | -c "Use context-specific verification callback" \ |
| 2454 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2455 | -C "error" |
| 2456 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2457 | # Tests for SHA-1 support |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2459 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2460 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2461 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 2462 | 1 \ |
| 2463 | -c "The certificate is signed with an unacceptable hash" |
| 2464 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2466 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2467 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 2468 | "$P_CLI allow_sha1=1" \ |
| 2469 | 0 |
| 2470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2472 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2473 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 2474 | "$P_CLI allow_sha1=0" \ |
| 2475 | 0 |
| 2476 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2478 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 2479 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2480 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2481 | 1 \ |
| 2482 | -s "The certificate is signed with an unacceptable hash" |
| 2483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2485 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 2486 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 2487 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2488 | 0 |
| 2489 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2491 | run_test "SHA-256 allowed by default in client certificate" \ |
| 2492 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 2493 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2494 | 0 |
| 2495 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2496 | # Dummy TLS 1.3 test |
| 2497 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 2498 | # ssl_client2/ssl_server2 example programs works. |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2502 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2503 | run_test "TLS 1.3: key exchange mode parameter passing: PSK only" \ |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2504 | "$P_SRV tls13_kex_modes=psk debug_level=4" \ |
| 2505 | "$P_CLI tls13_kex_modes=psk debug_level=4" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2506 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2507 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2511 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2512 | run_test "TLS 1.3: key exchange mode parameter passing: PSK-ephemeral only" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2513 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 2514 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 2515 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2516 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2520 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2521 | 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] | 2522 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 2523 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2524 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2525 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2528 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2529 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2530 | run_test "TLS 1.3: key exchange mode parameter passing: All ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2531 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 2532 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 2533 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2534 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2537 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2538 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2539 | run_test "TLS 1.3: key exchange mode parameter passing: All PSK" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2540 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 2541 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 2542 | 0 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2543 | |
Jerry Yu | c10f6b4 | 2021-12-23 17:16:42 +0800 | [diff] [blame] | 2544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 2545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Jerry Yu | e36397d | 2022-07-09 04:20:59 +0000 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 2547 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 2548 | run_test "TLS 1.3: key exchange mode parameter passing: All" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 2549 | "$P_SRV tls13_kex_modes=all" \ |
| 2550 | "$P_CLI tls13_kex_modes=all" \ |
| 2551 | 0 |
| 2552 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2553 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2555 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2556 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2557 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2558 | 0 \ |
| 2559 | -c "next record in same datagram" \ |
| 2560 | -s "next record in same datagram" |
| 2561 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2562 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2563 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2564 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2565 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2566 | 0 \ |
| 2567 | -s "next record in same datagram" \ |
| 2568 | -C "next record in same datagram" |
| 2569 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2571 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2572 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2573 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2574 | 0 \ |
| 2575 | -S "next record in same datagram" \ |
| 2576 | -c "next record in same datagram" |
| 2577 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2579 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2580 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2581 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2582 | 0 \ |
| 2583 | -S "next record in same datagram" \ |
| 2584 | -C "next record in same datagram" |
| 2585 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2586 | # Tests for Context serialization |
| 2587 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2589 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2590 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2591 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2592 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2593 | 0 \ |
| 2594 | -c "Deserializing connection..." \ |
| 2595 | -S "Deserializing connection..." |
| 2596 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2598 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2599 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2600 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2601 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2602 | 0 \ |
| 2603 | -c "Deserializing connection..." \ |
| 2604 | -S "Deserializing connection..." |
| 2605 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2607 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2608 | run_test "Context serialization, client serializes, GCM" \ |
| 2609 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2610 | "$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] | 2611 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2612 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2613 | -S "Deserializing connection..." |
| 2614 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2616 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2617 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2618 | run_test "Context serialization, client serializes, with CID" \ |
| 2619 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2620 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2621 | 0 \ |
| 2622 | -c "Deserializing connection..." \ |
| 2623 | -S "Deserializing connection..." |
| 2624 | |
| 2625 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2626 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2627 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2628 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2629 | 0 \ |
| 2630 | -C "Deserializing connection..." \ |
| 2631 | -s "Deserializing connection..." |
| 2632 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2635 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2636 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2637 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2638 | 0 \ |
| 2639 | -C "Deserializing connection..." \ |
| 2640 | -s "Deserializing connection..." |
| 2641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2643 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2644 | run_test "Context serialization, server serializes, GCM" \ |
| 2645 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2646 | "$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] | 2647 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2648 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2649 | -s "Deserializing connection..." |
| 2650 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2652 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2653 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2654 | run_test "Context serialization, server serializes, with CID" \ |
| 2655 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2656 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2657 | 0 \ |
| 2658 | -C "Deserializing connection..." \ |
| 2659 | -s "Deserializing connection..." |
| 2660 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2662 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2663 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2664 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2665 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2666 | 0 \ |
| 2667 | -c "Deserializing connection..." \ |
| 2668 | -s "Deserializing connection..." |
| 2669 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2671 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2672 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2673 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2674 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2675 | 0 \ |
| 2676 | -c "Deserializing connection..." \ |
| 2677 | -s "Deserializing connection..." |
| 2678 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2679 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2680 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2681 | run_test "Context serialization, both serialize, GCM" \ |
| 2682 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2683 | "$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] | 2684 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2685 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2686 | -s "Deserializing connection..." |
| 2687 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2688 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2689 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2690 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2691 | run_test "Context serialization, both serialize, with CID" \ |
| 2692 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2693 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2694 | 0 \ |
| 2695 | -c "Deserializing connection..." \ |
| 2696 | -s "Deserializing connection..." |
| 2697 | |
| 2698 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2699 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2700 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2701 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2702 | 0 \ |
| 2703 | -c "Deserializing connection..." \ |
| 2704 | -S "Deserializing connection..." |
| 2705 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2707 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2708 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2709 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2710 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2711 | 0 \ |
| 2712 | -c "Deserializing connection..." \ |
| 2713 | -S "Deserializing connection..." |
| 2714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2716 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2717 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2718 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2719 | "$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] | 2720 | 0 \ |
| 2721 | -c "Deserializing connection..." \ |
| 2722 | -S "Deserializing connection..." |
| 2723 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2725 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2726 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2727 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2728 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2729 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2730 | 0 \ |
| 2731 | -c "Deserializing connection..." \ |
| 2732 | -S "Deserializing connection..." |
| 2733 | |
| 2734 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2735 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2736 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2737 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2738 | 0 \ |
| 2739 | -C "Deserializing connection..." \ |
| 2740 | -s "Deserializing connection..." |
| 2741 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2743 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2744 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2745 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2746 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2747 | 0 \ |
| 2748 | -C "Deserializing connection..." \ |
| 2749 | -s "Deserializing connection..." |
| 2750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2752 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2753 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2754 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2755 | "$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] | 2756 | 0 \ |
| 2757 | -C "Deserializing connection..." \ |
| 2758 | -s "Deserializing connection..." |
| 2759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2762 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2763 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2764 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2765 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2766 | 0 \ |
| 2767 | -C "Deserializing connection..." \ |
| 2768 | -s "Deserializing connection..." |
| 2769 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2772 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2773 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2774 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2775 | 0 \ |
| 2776 | -c "Deserializing connection..." \ |
| 2777 | -s "Deserializing connection..." |
| 2778 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2780 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2781 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2782 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2783 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2784 | 0 \ |
| 2785 | -c "Deserializing connection..." \ |
| 2786 | -s "Deserializing connection..." |
| 2787 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2789 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2790 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2791 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2792 | "$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] | 2793 | 0 \ |
| 2794 | -c "Deserializing connection..." \ |
| 2795 | -s "Deserializing connection..." |
| 2796 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2797 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2798 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2799 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2800 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2801 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2802 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2803 | 0 \ |
| 2804 | -c "Deserializing connection..." \ |
| 2805 | -s "Deserializing connection..." |
| 2806 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2808 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2809 | run_test "Saving the serialized context to a file" \ |
| 2810 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2811 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2812 | 0 \ |
| 2813 | -s "Save serialized context to a file... ok" \ |
| 2814 | -c "Save serialized context to a file... ok" |
| 2815 | rm -f context_srv.txt |
| 2816 | rm -f context_cli.txt |
| 2817 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2818 | # Tests for DTLS Connection ID extension |
| 2819 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2820 | # So far, the CID API isn't implemented, so we can't |
| 2821 | # grep for output witnessing its use. This needs to be |
| 2822 | # changed once the CID extension is implemented. |
| 2823 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2824 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2825 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2826 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2827 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2828 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2829 | 0 \ |
| 2830 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2831 | -s "found CID extension" \ |
| 2832 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2833 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2834 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2835 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2836 | -C "found CID extension" \ |
| 2837 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2838 | -C "Copy CIDs into SSL transform" \ |
| 2839 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2840 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2842 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2843 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2844 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2845 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2846 | 0 \ |
| 2847 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2848 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2849 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2850 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2851 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2852 | -C "found CID extension" \ |
| 2853 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2854 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2855 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2856 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2858 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2859 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2860 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2861 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2862 | 0 \ |
| 2863 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2864 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2865 | -c "client hello, adding CID extension" \ |
| 2866 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2867 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2868 | -s "server hello, adding CID extension" \ |
| 2869 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2870 | -c "Use of CID extension negotiated" \ |
| 2871 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2872 | -c "Copy CIDs into SSL transform" \ |
| 2873 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2874 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2875 | -s "Use of Connection ID has been negotiated" \ |
| 2876 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2877 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2879 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2880 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2881 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2882 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2883 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2884 | 0 \ |
| 2885 | -c "Enable use of CID extension." \ |
| 2886 | -s "Enable use of CID extension." \ |
| 2887 | -c "client hello, adding CID extension" \ |
| 2888 | -s "found CID extension" \ |
| 2889 | -s "Use of CID extension negotiated" \ |
| 2890 | -s "server hello, adding CID extension" \ |
| 2891 | -c "found CID extension" \ |
| 2892 | -c "Use of CID extension negotiated" \ |
| 2893 | -s "Copy CIDs into SSL transform" \ |
| 2894 | -c "Copy CIDs into SSL transform" \ |
| 2895 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2896 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2897 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2898 | -c "Use of Connection ID has been negotiated" \ |
| 2899 | -c "ignoring unexpected CID" \ |
| 2900 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2901 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2903 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2904 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2905 | -p "$P_PXY mtu=800" \ |
| 2906 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2907 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2908 | 0 \ |
| 2909 | -c "Enable use of CID extension." \ |
| 2910 | -s "Enable use of CID extension." \ |
| 2911 | -c "client hello, adding CID extension" \ |
| 2912 | -s "found CID extension" \ |
| 2913 | -s "Use of CID extension negotiated" \ |
| 2914 | -s "server hello, adding CID extension" \ |
| 2915 | -c "found CID extension" \ |
| 2916 | -c "Use of CID extension negotiated" \ |
| 2917 | -s "Copy CIDs into SSL transform" \ |
| 2918 | -c "Copy CIDs into SSL transform" \ |
| 2919 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2920 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2921 | -s "Use of Connection ID has been negotiated" \ |
| 2922 | -c "Use of Connection ID has been negotiated" |
| 2923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2925 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2926 | 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] | 2927 | -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] | 2928 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2929 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2930 | 0 \ |
| 2931 | -c "Enable use of CID extension." \ |
| 2932 | -s "Enable use of CID extension." \ |
| 2933 | -c "client hello, adding CID extension" \ |
| 2934 | -s "found CID extension" \ |
| 2935 | -s "Use of CID extension negotiated" \ |
| 2936 | -s "server hello, adding CID extension" \ |
| 2937 | -c "found CID extension" \ |
| 2938 | -c "Use of CID extension negotiated" \ |
| 2939 | -s "Copy CIDs into SSL transform" \ |
| 2940 | -c "Copy CIDs into SSL transform" \ |
| 2941 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2942 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2943 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2944 | -c "Use of Connection ID has been negotiated" \ |
| 2945 | -c "ignoring unexpected CID" \ |
| 2946 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2950 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2951 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2952 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2953 | 0 \ |
| 2954 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2955 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2956 | -c "client hello, adding CID extension" \ |
| 2957 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2958 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2959 | -s "server hello, adding CID extension" \ |
| 2960 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2961 | -c "Use of CID extension negotiated" \ |
| 2962 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2963 | -c "Copy CIDs into SSL transform" \ |
| 2964 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2965 | -s "Peer CID (length 0 Bytes):" \ |
| 2966 | -s "Use of Connection ID has been negotiated" \ |
| 2967 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2968 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2969 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2971 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2972 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2973 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2974 | 0 \ |
| 2975 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2976 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2977 | -c "client hello, adding CID extension" \ |
| 2978 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2979 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2980 | -s "server hello, adding CID extension" \ |
| 2981 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2982 | -c "Use of CID extension negotiated" \ |
| 2983 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2984 | -c "Copy CIDs into SSL transform" \ |
| 2985 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2986 | -c "Peer CID (length 0 Bytes):" \ |
| 2987 | -s "Use of Connection ID has been negotiated" \ |
| 2988 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2989 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2990 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2991 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2992 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2993 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2994 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2995 | 0 \ |
| 2996 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2997 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2998 | -c "client hello, adding CID extension" \ |
| 2999 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3000 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3001 | -s "server hello, adding CID extension" \ |
| 3002 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3003 | -c "Use of CID extension negotiated" \ |
| 3004 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3005 | -c "Copy CIDs into SSL transform" \ |
| 3006 | -S "Use of Connection ID has been negotiated" \ |
| 3007 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3010 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3011 | 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] | 3012 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3013 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3014 | 0 \ |
| 3015 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3016 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3017 | -c "client hello, adding CID extension" \ |
| 3018 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3019 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3020 | -s "server hello, adding CID extension" \ |
| 3021 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3022 | -c "Use of CID extension negotiated" \ |
| 3023 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3024 | -c "Copy CIDs into SSL transform" \ |
| 3025 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3026 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3027 | -s "Use of Connection ID has been negotiated" \ |
| 3028 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3032 | 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] | 3033 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3034 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3035 | 0 \ |
| 3036 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3037 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3038 | -c "client hello, adding CID extension" \ |
| 3039 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3040 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3041 | -s "server hello, adding CID extension" \ |
| 3042 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3043 | -c "Use of CID extension negotiated" \ |
| 3044 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3045 | -c "Copy CIDs into SSL transform" \ |
| 3046 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3047 | -s "Peer CID (length 0 Bytes):" \ |
| 3048 | -s "Use of Connection ID has been negotiated" \ |
| 3049 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3050 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3051 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3053 | 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] | 3054 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3055 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3056 | 0 \ |
| 3057 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3058 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3059 | -c "client hello, adding CID extension" \ |
| 3060 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3061 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3062 | -s "server hello, adding CID extension" \ |
| 3063 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3064 | -c "Use of CID extension negotiated" \ |
| 3065 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3066 | -c "Copy CIDs into SSL transform" \ |
| 3067 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3068 | -c "Peer CID (length 0 Bytes):" \ |
| 3069 | -s "Use of Connection ID has been negotiated" \ |
| 3070 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3071 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3073 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3074 | 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] | 3075 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3076 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3077 | 0 \ |
| 3078 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3079 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3080 | -c "client hello, adding CID extension" \ |
| 3081 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3082 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3083 | -s "server hello, adding CID extension" \ |
| 3084 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3085 | -c "Use of CID extension negotiated" \ |
| 3086 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3087 | -c "Copy CIDs into SSL transform" \ |
| 3088 | -S "Use of Connection ID has been negotiated" \ |
| 3089 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3092 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3093 | 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] | 3094 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3095 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3096 | 0 \ |
| 3097 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3098 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3099 | -c "client hello, adding CID extension" \ |
| 3100 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3101 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3102 | -s "server hello, adding CID extension" \ |
| 3103 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3104 | -c "Use of CID extension negotiated" \ |
| 3105 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3106 | -c "Copy CIDs into SSL transform" \ |
| 3107 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3108 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3109 | -s "Use of Connection ID has been negotiated" \ |
| 3110 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3113 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3114 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3115 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3116 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3117 | 0 \ |
| 3118 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3119 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3120 | -c "client hello, adding CID extension" \ |
| 3121 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3122 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3123 | -s "server hello, adding CID extension" \ |
| 3124 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3125 | -c "Use of CID extension negotiated" \ |
| 3126 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3127 | -c "Copy CIDs into SSL transform" \ |
| 3128 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3129 | -s "Peer CID (length 0 Bytes):" \ |
| 3130 | -s "Use of Connection ID has been negotiated" \ |
| 3131 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3132 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3134 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3135 | 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] | 3136 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3137 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3138 | 0 \ |
| 3139 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3140 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3141 | -c "client hello, adding CID extension" \ |
| 3142 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3143 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3144 | -s "server hello, adding CID extension" \ |
| 3145 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3146 | -c "Use of CID extension negotiated" \ |
| 3147 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3148 | -c "Copy CIDs into SSL transform" \ |
| 3149 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3150 | -c "Peer CID (length 0 Bytes):" \ |
| 3151 | -s "Use of Connection ID has been negotiated" \ |
| 3152 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3153 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3155 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3156 | 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] | 3157 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3158 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3159 | 0 \ |
| 3160 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3161 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3162 | -c "client hello, adding CID extension" \ |
| 3163 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3164 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3165 | -s "server hello, adding CID extension" \ |
| 3166 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3167 | -c "Use of CID extension negotiated" \ |
| 3168 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3169 | -c "Copy CIDs into SSL transform" \ |
| 3170 | -S "Use of Connection ID has been negotiated" \ |
| 3171 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3172 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3174 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3175 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3176 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3177 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3178 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3179 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3180 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3181 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3182 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3183 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3184 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3185 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3186 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3187 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3188 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3190 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3192 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3193 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3194 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3195 | 0 \ |
| 3196 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3197 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3198 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3199 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3200 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3201 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3202 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3203 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3204 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3206 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3207 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3208 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3209 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3210 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3211 | 0 \ |
| 3212 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3213 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3214 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3215 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3216 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3217 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3218 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3219 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3220 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3222 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3223 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3224 | 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] | 3225 | -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] | 3226 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3227 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3228 | 0 \ |
| 3229 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3230 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3231 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3232 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3233 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3234 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3235 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3236 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3237 | -c "ignoring unexpected CID" \ |
| 3238 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3239 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3241 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3243 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3244 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3245 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3246 | 0 \ |
| 3247 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3248 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3249 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3250 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3251 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3252 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3253 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3254 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3257 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3259 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3260 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3261 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3262 | 0 \ |
| 3263 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3264 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3265 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3266 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3267 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3268 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3269 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3270 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3271 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3273 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3275 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3276 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3277 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3278 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3279 | 0 \ |
| 3280 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3281 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3282 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3283 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3284 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3285 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3286 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3287 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3288 | -c "ignoring unexpected CID" \ |
| 3289 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3290 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3293 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3294 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3295 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3296 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3297 | 0 \ |
| 3298 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3299 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3300 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3301 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3302 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3303 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3304 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3308 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3309 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3310 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3311 | 0 \ |
| 3312 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3313 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3314 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3315 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3316 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3317 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3318 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3320 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3322 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3323 | -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] | 3324 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3325 | "$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" \ |
| 3326 | 0 \ |
| 3327 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3328 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3329 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3330 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3331 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3332 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3333 | -c "ignoring unexpected CID" \ |
| 3334 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3335 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3337 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3339 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3340 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3341 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3342 | 0 \ |
| 3343 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3344 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3345 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3346 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3347 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3348 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3349 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3350 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3351 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3356 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3357 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3359 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3360 | 0 \ |
| 3361 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3362 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3363 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3364 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3365 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3366 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3367 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3368 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3369 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3370 | -c "ignoring unexpected CID" \ |
| 3371 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3372 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3376 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3377 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3378 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3379 | 0 \ |
| 3380 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3381 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3382 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3383 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3384 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3385 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3386 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3387 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3388 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3389 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3391 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3393 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3394 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3395 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3396 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3397 | 0 \ |
| 3398 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3399 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3400 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3401 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3402 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3403 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3404 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3405 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3406 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3407 | -c "ignoring unexpected CID" \ |
| 3408 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3409 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3410 | # 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] | 3411 | # tests check that the buffer contents are reallocated when the message is |
| 3412 | # larger than the buffer. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3413 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3415 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3416 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3417 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3418 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3419 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3420 | 0 \ |
| 3421 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3422 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3423 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3424 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3425 | -s "Reallocating in_buf" \ |
| 3426 | -s "Reallocating out_buf" |
| 3427 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3429 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3430 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3431 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3432 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3433 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3434 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3435 | 0 \ |
| 3436 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3437 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3438 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3439 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3440 | -s "Reallocating in_buf" \ |
| 3441 | -s "Reallocating out_buf" |
| 3442 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3443 | # Tests for Encrypt-then-MAC extension |
| 3444 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3446 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3447 | "$P_SRV debug_level=3 \ |
| 3448 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3449 | "$P_CLI debug_level=3" \ |
| 3450 | 0 \ |
| 3451 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3452 | -s "found encrypt then mac extension" \ |
| 3453 | -s "server hello, adding encrypt then mac extension" \ |
| 3454 | -c "found encrypt_then_mac extension" \ |
| 3455 | -c "using encrypt then mac" \ |
| 3456 | -s "using encrypt then mac" |
| 3457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3459 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3460 | "$P_SRV debug_level=3 etm=0 \ |
| 3461 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3462 | "$P_CLI debug_level=3 etm=1" \ |
| 3463 | 0 \ |
| 3464 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3465 | -s "found encrypt then mac extension" \ |
| 3466 | -S "server hello, adding encrypt then mac extension" \ |
| 3467 | -C "found encrypt_then_mac extension" \ |
| 3468 | -C "using encrypt then mac" \ |
| 3469 | -S "using encrypt then mac" |
| 3470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3472 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3473 | "$P_SRV debug_level=3 etm=1 \ |
| 3474 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3475 | "$P_CLI debug_level=3 etm=1" \ |
| 3476 | 0 \ |
| 3477 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3478 | -s "found encrypt then mac extension" \ |
| 3479 | -S "server hello, adding encrypt then mac extension" \ |
| 3480 | -C "found encrypt_then_mac extension" \ |
| 3481 | -C "using encrypt then mac" \ |
| 3482 | -S "using encrypt then mac" |
| 3483 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3485 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3486 | "$P_SRV debug_level=3 etm=1 \ |
| 3487 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3488 | "$P_CLI debug_level=3 etm=0" \ |
| 3489 | 0 \ |
| 3490 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3491 | -S "found encrypt then mac extension" \ |
| 3492 | -S "server hello, adding encrypt then mac extension" \ |
| 3493 | -C "found encrypt_then_mac extension" \ |
| 3494 | -C "using encrypt then mac" \ |
| 3495 | -S "using encrypt then mac" |
| 3496 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3497 | # Tests for Extended Master Secret extension |
| 3498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3500 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3501 | run_test "Extended Master Secret: default" \ |
| 3502 | "$P_SRV debug_level=3" \ |
| 3503 | "$P_CLI debug_level=3" \ |
| 3504 | 0 \ |
| 3505 | -c "client hello, adding extended_master_secret extension" \ |
| 3506 | -s "found extended master secret extension" \ |
| 3507 | -s "server hello, adding extended master secret extension" \ |
| 3508 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3509 | -c "session hash for extended master secret" \ |
| 3510 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3511 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3513 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3514 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3515 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 3516 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 3517 | 0 \ |
| 3518 | -c "client hello, adding extended_master_secret extension" \ |
| 3519 | -s "found extended master secret extension" \ |
| 3520 | -S "server hello, adding extended master secret extension" \ |
| 3521 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3522 | -C "session hash for extended master secret" \ |
| 3523 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3524 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3526 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3527 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 3528 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 3529 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3530 | 0 \ |
| 3531 | -C "client hello, adding extended_master_secret extension" \ |
| 3532 | -S "found extended master secret extension" \ |
| 3533 | -S "server hello, adding extended master secret extension" \ |
| 3534 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3535 | -C "session hash for extended master secret" \ |
| 3536 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3537 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3538 | # Test sending and receiving empty application data records |
| 3539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3541 | run_test "Encrypt then MAC: empty application data record" \ |
| 3542 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3543 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3544 | 0 \ |
| 3545 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3546 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3547 | -c "0 bytes written in 1 fragments" |
| 3548 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3550 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3551 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3552 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3553 | 0 \ |
| 3554 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3555 | -c "0 bytes written in 1 fragments" |
| 3556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3558 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3559 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3560 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3561 | 0 \ |
| 3562 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3563 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3564 | -c "0 bytes written in 1 fragments" |
| 3565 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3567 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3568 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3569 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3570 | 0 \ |
| 3571 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3572 | -c "0 bytes written in 1 fragments" |
| 3573 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3574 | # Tests for CBC 1/n-1 record splitting |
| 3575 | |
| 3576 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3577 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3578 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3579 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3580 | 0 \ |
| 3581 | -s "Read from client: 123 bytes read" \ |
| 3582 | -S "Read from client: 1 bytes read" \ |
| 3583 | -S "122 bytes read" |
| 3584 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3585 | # Tests for Session Tickets |
| 3586 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3588 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3589 | "$P_SRV debug_level=3 tickets=1" \ |
| 3590 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3591 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3592 | -c "client hello, adding session ticket extension" \ |
| 3593 | -s "found session ticket extension" \ |
| 3594 | -s "server hello, adding session ticket extension" \ |
| 3595 | -c "found session_ticket extension" \ |
| 3596 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3597 | -S "session successfully restored from cache" \ |
| 3598 | -s "session successfully restored from ticket" \ |
| 3599 | -s "a session has been resumed" \ |
| 3600 | -c "a session has been resumed" |
| 3601 | |
Jerry Yu | baa4934 | 2022-02-15 10:26:40 +0800 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3603 | run_test "Session resume using tickets: manual rotation" \ |
| 3604 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
| 3605 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3606 | 0 \ |
| 3607 | -c "client hello, adding session ticket extension" \ |
| 3608 | -s "found session ticket extension" \ |
| 3609 | -s "server hello, adding session ticket extension" \ |
| 3610 | -c "found session_ticket extension" \ |
| 3611 | -c "parse new session ticket" \ |
| 3612 | -S "session successfully restored from cache" \ |
| 3613 | -s "session successfully restored from ticket" \ |
| 3614 | -s "a session has been resumed" \ |
| 3615 | -c "a session has been resumed" |
| 3616 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3617 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3618 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3619 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3620 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3621 | 0 \ |
| 3622 | -c "client hello, adding session ticket extension" \ |
| 3623 | -s "found session ticket extension" \ |
| 3624 | -s "server hello, adding session ticket extension" \ |
| 3625 | -c "found session_ticket extension" \ |
| 3626 | -c "parse new session ticket" \ |
| 3627 | -S "session successfully restored from cache" \ |
| 3628 | -s "session successfully restored from ticket" \ |
| 3629 | -s "a session has been resumed" \ |
| 3630 | -c "a session has been resumed" |
| 3631 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3632 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3633 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3634 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3635 | "$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] | 3636 | 0 \ |
| 3637 | -c "client hello, adding session ticket extension" \ |
| 3638 | -s "found session ticket extension" \ |
| 3639 | -s "server hello, adding session ticket extension" \ |
| 3640 | -c "found session_ticket extension" \ |
| 3641 | -c "parse new session ticket" \ |
| 3642 | -S "session successfully restored from cache" \ |
| 3643 | -S "session successfully restored from ticket" \ |
| 3644 | -S "a session has been resumed" \ |
| 3645 | -C "a session has been resumed" |
| 3646 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3648 | run_test "Session resume using tickets: session copy" \ |
| 3649 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3650 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3651 | 0 \ |
| 3652 | -c "client hello, adding session ticket extension" \ |
| 3653 | -s "found session ticket extension" \ |
| 3654 | -s "server hello, adding session ticket extension" \ |
| 3655 | -c "found session_ticket extension" \ |
| 3656 | -c "parse new session ticket" \ |
| 3657 | -S "session successfully restored from cache" \ |
| 3658 | -s "session successfully restored from ticket" \ |
| 3659 | -s "a session has been resumed" \ |
| 3660 | -c "a session has been resumed" |
| 3661 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3663 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3664 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3665 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3666 | 0 \ |
| 3667 | -c "client hello, adding session ticket extension" \ |
| 3668 | -c "found session_ticket extension" \ |
| 3669 | -c "parse new session ticket" \ |
| 3670 | -c "a session has been resumed" |
| 3671 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3673 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3674 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3675 | "( $O_CLI -sess_out $SESSION; \ |
| 3676 | $O_CLI -sess_in $SESSION; \ |
| 3677 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3678 | 0 \ |
| 3679 | -s "found session ticket extension" \ |
| 3680 | -s "server hello, adding session ticket extension" \ |
| 3681 | -S "session successfully restored from cache" \ |
| 3682 | -s "session successfully restored from ticket" \ |
| 3683 | -s "a session has been resumed" |
| 3684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3686 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3687 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
| 3688 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3689 | 0 \ |
| 3690 | -c "client hello, adding session ticket extension" \ |
| 3691 | -s "found session ticket extension" \ |
| 3692 | -s "server hello, adding session ticket extension" \ |
| 3693 | -c "found session_ticket extension" \ |
| 3694 | -c "parse new session ticket" \ |
| 3695 | -S "session successfully restored from cache" \ |
| 3696 | -s "session successfully restored from ticket" \ |
| 3697 | -s "a session has been resumed" \ |
| 3698 | -c "a session has been resumed" |
| 3699 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3701 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3702 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
| 3703 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3704 | 0 \ |
| 3705 | -c "client hello, adding session ticket extension" \ |
| 3706 | -s "found session ticket extension" \ |
| 3707 | -s "server hello, adding session ticket extension" \ |
| 3708 | -c "found session_ticket extension" \ |
| 3709 | -c "parse new session ticket" \ |
| 3710 | -S "session successfully restored from cache" \ |
| 3711 | -s "session successfully restored from ticket" \ |
| 3712 | -s "a session has been resumed" \ |
| 3713 | -c "a session has been resumed" |
| 3714 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3715 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3716 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3717 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
| 3718 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3719 | 0 \ |
| 3720 | -c "client hello, adding session ticket extension" \ |
| 3721 | -s "found session ticket extension" \ |
| 3722 | -s "server hello, adding session ticket extension" \ |
| 3723 | -c "found session_ticket extension" \ |
| 3724 | -c "parse new session ticket" \ |
| 3725 | -S "session successfully restored from cache" \ |
| 3726 | -s "session successfully restored from ticket" \ |
| 3727 | -s "a session has been resumed" \ |
| 3728 | -c "a session has been resumed" |
| 3729 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3731 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3732 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
| 3733 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3734 | 0 \ |
| 3735 | -c "client hello, adding session ticket extension" \ |
| 3736 | -s "found session ticket extension" \ |
| 3737 | -s "server hello, adding session ticket extension" \ |
| 3738 | -c "found session_ticket extension" \ |
| 3739 | -c "parse new session ticket" \ |
| 3740 | -S "session successfully restored from cache" \ |
| 3741 | -s "session successfully restored from ticket" \ |
| 3742 | -s "a session has been resumed" \ |
| 3743 | -c "a session has been resumed" |
| 3744 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3745 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3746 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3747 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
| 3748 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3749 | 0 \ |
| 3750 | -c "client hello, adding session ticket extension" \ |
| 3751 | -s "found session ticket extension" \ |
| 3752 | -s "server hello, adding session ticket extension" \ |
| 3753 | -c "found session_ticket extension" \ |
| 3754 | -c "parse new session ticket" \ |
| 3755 | -S "session successfully restored from cache" \ |
| 3756 | -s "session successfully restored from ticket" \ |
| 3757 | -s "a session has been resumed" \ |
| 3758 | -c "a session has been resumed" |
| 3759 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3761 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3762 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
| 3763 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3764 | 0 \ |
| 3765 | -c "client hello, adding session ticket extension" \ |
| 3766 | -s "found session ticket extension" \ |
| 3767 | -s "server hello, adding session ticket extension" \ |
| 3768 | -c "found session_ticket extension" \ |
| 3769 | -c "parse new session ticket" \ |
| 3770 | -S "session successfully restored from cache" \ |
| 3771 | -s "session successfully restored from ticket" \ |
| 3772 | -s "a session has been resumed" \ |
| 3773 | -c "a session has been resumed" |
| 3774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3776 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3777 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
| 3778 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3779 | 0 \ |
| 3780 | -c "client hello, adding session ticket extension" \ |
| 3781 | -s "found session ticket extension" \ |
| 3782 | -s "server hello, adding session ticket extension" \ |
| 3783 | -c "found session_ticket extension" \ |
| 3784 | -c "parse new session ticket" \ |
| 3785 | -S "session successfully restored from cache" \ |
| 3786 | -s "session successfully restored from ticket" \ |
| 3787 | -s "a session has been resumed" \ |
| 3788 | -c "a session has been resumed" |
| 3789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3791 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3792 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
| 3793 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3794 | 0 \ |
| 3795 | -c "client hello, adding session ticket extension" \ |
| 3796 | -s "found session ticket extension" \ |
| 3797 | -s "server hello, adding session ticket extension" \ |
| 3798 | -c "found session_ticket extension" \ |
| 3799 | -c "parse new session ticket" \ |
| 3800 | -S "session successfully restored from cache" \ |
| 3801 | -s "session successfully restored from ticket" \ |
| 3802 | -s "a session has been resumed" \ |
| 3803 | -c "a session has been resumed" |
| 3804 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3805 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3806 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3807 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
| 3808 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3809 | 0 \ |
| 3810 | -c "client hello, adding session ticket extension" \ |
| 3811 | -s "found session ticket extension" \ |
| 3812 | -s "server hello, adding session ticket extension" \ |
| 3813 | -c "found session_ticket extension" \ |
| 3814 | -c "parse new session ticket" \ |
| 3815 | -S "session successfully restored from cache" \ |
| 3816 | -s "session successfully restored from ticket" \ |
| 3817 | -s "a session has been resumed" \ |
| 3818 | -c "a session has been resumed" |
| 3819 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3820 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3821 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3822 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
| 3823 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3824 | 0 \ |
| 3825 | -c "client hello, adding session ticket extension" \ |
| 3826 | -s "found session ticket extension" \ |
| 3827 | -s "server hello, adding session ticket extension" \ |
| 3828 | -c "found session_ticket extension" \ |
| 3829 | -c "parse new session ticket" \ |
| 3830 | -S "session successfully restored from cache" \ |
| 3831 | -s "session successfully restored from ticket" \ |
| 3832 | -s "a session has been resumed" \ |
| 3833 | -c "a session has been resumed" |
| 3834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3836 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3837 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
| 3838 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3839 | 0 \ |
| 3840 | -c "client hello, adding session ticket extension" \ |
| 3841 | -s "found session ticket extension" \ |
| 3842 | -s "server hello, adding session ticket extension" \ |
| 3843 | -c "found session_ticket extension" \ |
| 3844 | -c "parse new session ticket" \ |
| 3845 | -S "session successfully restored from cache" \ |
| 3846 | -s "session successfully restored from ticket" \ |
| 3847 | -s "a session has been resumed" \ |
| 3848 | -c "a session has been resumed" |
| 3849 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3851 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3852 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
| 3853 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3854 | 0 \ |
| 3855 | -c "client hello, adding session ticket extension" \ |
| 3856 | -s "found session ticket extension" \ |
| 3857 | -s "server hello, adding session ticket extension" \ |
| 3858 | -c "found session_ticket extension" \ |
| 3859 | -c "parse new session ticket" \ |
| 3860 | -S "session successfully restored from cache" \ |
| 3861 | -s "session successfully restored from ticket" \ |
| 3862 | -s "a session has been resumed" \ |
| 3863 | -c "a session has been resumed" |
| 3864 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3865 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3866 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 3867 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
| 3868 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3869 | 0 \ |
| 3870 | -c "client hello, adding session ticket extension" \ |
| 3871 | -s "found session ticket extension" \ |
| 3872 | -s "server hello, adding session ticket extension" \ |
| 3873 | -c "found session_ticket extension" \ |
| 3874 | -c "parse new session ticket" \ |
| 3875 | -S "session successfully restored from cache" \ |
| 3876 | -s "session successfully restored from ticket" \ |
| 3877 | -s "a session has been resumed" \ |
| 3878 | -c "a session has been resumed" |
| 3879 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3881 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 3882 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
| 3883 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3884 | 0 \ |
| 3885 | -c "client hello, adding session ticket extension" \ |
| 3886 | -s "found session ticket extension" \ |
| 3887 | -s "server hello, adding session ticket extension" \ |
| 3888 | -c "found session_ticket extension" \ |
| 3889 | -c "parse new session ticket" \ |
| 3890 | -S "session successfully restored from cache" \ |
| 3891 | -s "session successfully restored from ticket" \ |
| 3892 | -s "a session has been resumed" \ |
| 3893 | -c "a session has been resumed" |
| 3894 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 3895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 3896 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 3897 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
| 3898 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
| 3899 | 0 \ |
| 3900 | -c "client hello, adding session ticket extension" \ |
| 3901 | -s "found session ticket extension" \ |
| 3902 | -s "server hello, adding session ticket extension" \ |
| 3903 | -c "found session_ticket extension" \ |
| 3904 | -c "parse new session ticket" \ |
| 3905 | -S "session successfully restored from cache" \ |
| 3906 | -s "session successfully restored from ticket" \ |
| 3907 | -s "a session has been resumed" \ |
| 3908 | -c "a session has been resumed" |
| 3909 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3910 | # Tests for Session Tickets with DTLS |
| 3911 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3912 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3913 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3914 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3915 | "$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] | 3916 | 0 \ |
| 3917 | -c "client hello, adding session ticket extension" \ |
| 3918 | -s "found session ticket extension" \ |
| 3919 | -s "server hello, adding session ticket extension" \ |
| 3920 | -c "found session_ticket extension" \ |
| 3921 | -c "parse new session ticket" \ |
| 3922 | -S "session successfully restored from cache" \ |
| 3923 | -s "session successfully restored from ticket" \ |
| 3924 | -s "a session has been resumed" \ |
| 3925 | -c "a session has been resumed" |
| 3926 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3927 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3928 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3929 | "$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] | 3930 | "$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] | 3931 | 0 \ |
| 3932 | -c "client hello, adding session ticket extension" \ |
| 3933 | -s "found session ticket extension" \ |
| 3934 | -s "server hello, adding session ticket extension" \ |
| 3935 | -c "found session_ticket extension" \ |
| 3936 | -c "parse new session ticket" \ |
| 3937 | -S "session successfully restored from cache" \ |
| 3938 | -s "session successfully restored from ticket" \ |
| 3939 | -s "a session has been resumed" \ |
| 3940 | -c "a session has been resumed" |
| 3941 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3943 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3944 | "$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] | 3945 | "$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] | 3946 | 0 \ |
| 3947 | -c "client hello, adding session ticket extension" \ |
| 3948 | -s "found session ticket extension" \ |
| 3949 | -s "server hello, adding session ticket extension" \ |
| 3950 | -c "found session_ticket extension" \ |
| 3951 | -c "parse new session ticket" \ |
| 3952 | -S "session successfully restored from cache" \ |
| 3953 | -S "session successfully restored from ticket" \ |
| 3954 | -S "a session has been resumed" \ |
| 3955 | -C "a session has been resumed" |
| 3956 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3958 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3959 | "$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] | 3960 | "$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] | 3961 | 0 \ |
| 3962 | -c "client hello, adding session ticket extension" \ |
| 3963 | -s "found session ticket extension" \ |
| 3964 | -s "server hello, adding session ticket extension" \ |
| 3965 | -c "found session_ticket extension" \ |
| 3966 | -c "parse new session ticket" \ |
| 3967 | -S "session successfully restored from cache" \ |
| 3968 | -s "session successfully restored from ticket" \ |
| 3969 | -s "a session has been resumed" \ |
| 3970 | -c "a session has been resumed" |
| 3971 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3973 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3974 | "$O_SRV -dtls" \ |
| 3975 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3976 | 0 \ |
| 3977 | -c "client hello, adding session ticket extension" \ |
| 3978 | -c "found session_ticket extension" \ |
| 3979 | -c "parse new session ticket" \ |
| 3980 | -c "a session has been resumed" |
| 3981 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3982 | # 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] | 3983 | # 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] | 3984 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3986 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3987 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3988 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 3989 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 3990 | rm -f $SESSION )" \ |
| 3991 | 0 \ |
| 3992 | -s "found session ticket extension" \ |
| 3993 | -s "server hello, adding session ticket extension" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" |
| 3997 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3998 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3999 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4002 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4003 | "$P_SRV debug_level=3 tickets=0" \ |
| 4004 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4005 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4006 | -c "client hello, adding session ticket extension" \ |
| 4007 | -s "found session ticket extension" \ |
| 4008 | -S "server hello, adding session ticket extension" \ |
| 4009 | -C "found session_ticket extension" \ |
| 4010 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4011 | -s "session successfully restored from cache" \ |
| 4012 | -S "session successfully restored from ticket" \ |
| 4013 | -s "a session has been resumed" \ |
| 4014 | -c "a session has been resumed" |
| 4015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4018 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4019 | "$P_SRV debug_level=3 tickets=1" \ |
| 4020 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4021 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4022 | -C "client hello, adding session ticket extension" \ |
| 4023 | -S "found session ticket extension" \ |
| 4024 | -S "server hello, adding session ticket extension" \ |
| 4025 | -C "found session_ticket extension" \ |
| 4026 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4027 | -s "session successfully restored from cache" \ |
| 4028 | -S "session successfully restored from ticket" \ |
| 4029 | -s "a session has been resumed" \ |
| 4030 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4031 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4033 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4034 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4035 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 4036 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4037 | 0 \ |
| 4038 | -S "session successfully restored from cache" \ |
| 4039 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4040 | -S "a session has been resumed" \ |
| 4041 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4045 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4046 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 4047 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4048 | 0 \ |
| 4049 | -s "session successfully restored from cache" \ |
| 4050 | -S "session successfully restored from ticket" \ |
| 4051 | -s "a session has been resumed" \ |
| 4052 | -c "a session has been resumed" |
| 4053 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4054 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4055 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4056 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4057 | "$P_SRV debug_level=3 tickets=0" \ |
| 4058 | "$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] | 4059 | 0 \ |
| 4060 | -s "session successfully restored from cache" \ |
| 4061 | -S "session successfully restored from ticket" \ |
| 4062 | -s "a session has been resumed" \ |
| 4063 | -c "a session has been resumed" |
| 4064 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4066 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4067 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4068 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 4069 | "$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] | 4070 | 0 \ |
| 4071 | -S "session successfully restored from cache" \ |
| 4072 | -S "session successfully restored from ticket" \ |
| 4073 | -S "a session has been resumed" \ |
| 4074 | -C "a session has been resumed" |
| 4075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4077 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4078 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4079 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 4080 | "$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] | 4081 | 0 \ |
| 4082 | -s "session successfully restored from cache" \ |
| 4083 | -S "session successfully restored from ticket" \ |
| 4084 | -s "a session has been resumed" \ |
| 4085 | -c "a session has been resumed" |
| 4086 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4088 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4089 | run_test "Session resume using cache: session copy" \ |
| 4090 | "$P_SRV debug_level=3 tickets=0" \ |
| 4091 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 4092 | 0 \ |
| 4093 | -s "session successfully restored from cache" \ |
| 4094 | -S "session successfully restored from ticket" \ |
| 4095 | -s "a session has been resumed" \ |
| 4096 | -c "a session has been resumed" |
| 4097 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4099 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4100 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4101 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4102 | "( $O_CLI -sess_out $SESSION; \ |
| 4103 | $O_CLI -sess_in $SESSION; \ |
| 4104 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4105 | 0 \ |
| 4106 | -s "found session ticket extension" \ |
| 4107 | -S "server hello, adding session ticket extension" \ |
| 4108 | -s "session successfully restored from cache" \ |
| 4109 | -S "session successfully restored from ticket" \ |
| 4110 | -s "a session has been resumed" |
| 4111 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4113 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4114 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4115 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4116 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4117 | 0 \ |
| 4118 | -C "found session_ticket extension" \ |
| 4119 | -C "parse new session ticket" \ |
| 4120 | -c "a session has been resumed" |
| 4121 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4122 | # Tests for Session resume and extensions |
| 4123 | |
| 4124 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4125 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4126 | run_test "Session resume and connection ID" \ |
| 4127 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4128 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4129 | 0 \ |
| 4130 | -c "Enable use of CID extension." \ |
| 4131 | -s "Enable use of CID extension." \ |
| 4132 | -c "client hello, adding CID extension" \ |
| 4133 | -s "found CID extension" \ |
| 4134 | -s "Use of CID extension negotiated" \ |
| 4135 | -s "server hello, adding CID extension" \ |
| 4136 | -c "found CID extension" \ |
| 4137 | -c "Use of CID extension negotiated" \ |
| 4138 | -s "Copy CIDs into SSL transform" \ |
| 4139 | -c "Copy CIDs into SSL transform" \ |
| 4140 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4141 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4142 | -s "Use of Connection ID has been negotiated" \ |
| 4143 | -c "Use of Connection ID has been negotiated" |
| 4144 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4145 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4146 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4147 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4148 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4149 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4150 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4151 | "$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] | 4152 | 0 \ |
| 4153 | -c "client hello, adding session ticket extension" \ |
| 4154 | -s "found session ticket extension" \ |
| 4155 | -S "server hello, adding session ticket extension" \ |
| 4156 | -C "found session_ticket extension" \ |
| 4157 | -C "parse new session ticket" \ |
| 4158 | -s "session successfully restored from cache" \ |
| 4159 | -S "session successfully restored from ticket" \ |
| 4160 | -s "a session has been resumed" \ |
| 4161 | -c "a session has been resumed" |
| 4162 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4164 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4165 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4166 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4167 | "$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] | 4168 | 0 \ |
| 4169 | -C "client hello, adding session ticket extension" \ |
| 4170 | -S "found session ticket extension" \ |
| 4171 | -S "server hello, adding session ticket extension" \ |
| 4172 | -C "found session_ticket extension" \ |
| 4173 | -C "parse new session ticket" \ |
| 4174 | -s "session successfully restored from cache" \ |
| 4175 | -S "session successfully restored from ticket" \ |
| 4176 | -s "a session has been resumed" \ |
| 4177 | -c "a session has been resumed" |
| 4178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4180 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4181 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4182 | "$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] | 4183 | "$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] | 4184 | 0 \ |
| 4185 | -S "session successfully restored from cache" \ |
| 4186 | -S "session successfully restored from ticket" \ |
| 4187 | -S "a session has been resumed" \ |
| 4188 | -C "a session has been resumed" |
| 4189 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4191 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4192 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4193 | "$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] | 4194 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4195 | 0 \ |
| 4196 | -s "session successfully restored from cache" \ |
| 4197 | -S "session successfully restored from ticket" \ |
| 4198 | -s "a session has been resumed" \ |
| 4199 | -c "a session has been resumed" |
| 4200 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4202 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4203 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4204 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4205 | "$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] | 4206 | 0 \ |
| 4207 | -s "session successfully restored from cache" \ |
| 4208 | -S "session successfully restored from ticket" \ |
| 4209 | -s "a session has been resumed" \ |
| 4210 | -c "a session has been resumed" |
| 4211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4213 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4214 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4215 | "$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] | 4216 | "$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] | 4217 | 0 \ |
| 4218 | -S "session successfully restored from cache" \ |
| 4219 | -S "session successfully restored from ticket" \ |
| 4220 | -S "a session has been resumed" \ |
| 4221 | -C "a session has been resumed" |
| 4222 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4225 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4226 | "$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] | 4227 | "$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] | 4228 | 0 \ |
| 4229 | -s "session successfully restored from cache" \ |
| 4230 | -S "session successfully restored from ticket" \ |
| 4231 | -s "a session has been resumed" \ |
| 4232 | -c "a session has been resumed" |
| 4233 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4234 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4235 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4236 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4237 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4238 | "$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] | 4239 | 0 \ |
| 4240 | -s "session successfully restored from cache" \ |
| 4241 | -S "session successfully restored from ticket" \ |
| 4242 | -s "a session has been resumed" \ |
| 4243 | -c "a session has been resumed" |
| 4244 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4245 | # 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] | 4246 | # 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] | 4247 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4250 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4251 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4252 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4253 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4254 | rm -f $SESSION )" \ |
| 4255 | 0 \ |
| 4256 | -s "found session ticket extension" \ |
| 4257 | -S "server hello, adding session ticket extension" \ |
| 4258 | -s "session successfully restored from cache" \ |
| 4259 | -S "session successfully restored from ticket" \ |
| 4260 | -s "a session has been resumed" |
| 4261 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4262 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4263 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4264 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4265 | "$O_SRV -dtls" \ |
| 4266 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4267 | 0 \ |
| 4268 | -C "found session_ticket extension" \ |
| 4269 | -C "parse new session ticket" \ |
| 4270 | -c "a session has been resumed" |
| 4271 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4272 | # Tests for Max Fragment Length extension |
| 4273 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4274 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4276 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4277 | "$P_SRV debug_level=3" \ |
| 4278 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4279 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4280 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4281 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4282 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4283 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4284 | -C "client hello, adding max_fragment_length extension" \ |
| 4285 | -S "found max fragment length extension" \ |
| 4286 | -S "server hello, max_fragment_length extension" \ |
| 4287 | -C "found max_fragment_length extension" |
| 4288 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4289 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4291 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4292 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4293 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4294 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4295 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4296 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4297 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4298 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4299 | -C "client hello, adding max_fragment_length extension" \ |
| 4300 | -S "found max fragment length extension" \ |
| 4301 | -S "server hello, max_fragment_length extension" \ |
| 4302 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4303 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4304 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4305 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4306 | |
| 4307 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4309 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4310 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4311 | "$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] | 4312 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4313 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4314 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4315 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4316 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4317 | -C "client hello, adding max_fragment_length extension" \ |
| 4318 | -S "found max fragment length extension" \ |
| 4319 | -S "server hello, max_fragment_length extension" \ |
| 4320 | -C "found max_fragment_length extension" \ |
| 4321 | -c "fragment larger than.*maximum " |
| 4322 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4323 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4324 | # (session fragment length will be 16384 regardless of mbedtls |
| 4325 | # content length configuration.) |
| 4326 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4327 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4329 | run_test "Max fragment length: disabled, larger message" \ |
| 4330 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4331 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4332 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4333 | -C "Maximum incoming record payload length is 16384" \ |
| 4334 | -C "Maximum outgoing record payload length is 16384" \ |
| 4335 | -S "Maximum incoming record payload length is 16384" \ |
| 4336 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4337 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4338 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4339 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4340 | |
| 4341 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4343 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4344 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4345 | "$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] | 4346 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4347 | -C "Maximum incoming record payload length is 16384" \ |
| 4348 | -C "Maximum outgoing record payload length is 16384" \ |
| 4349 | -S "Maximum incoming record payload length is 16384" \ |
| 4350 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4351 | -c "fragment larger than.*maximum " |
| 4352 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4353 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4354 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4356 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4357 | "$P_SRV debug_level=3" \ |
| 4358 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4359 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4360 | -c "Maximum incoming record payload length is 4096" \ |
| 4361 | -c "Maximum outgoing record payload length is 4096" \ |
| 4362 | -s "Maximum incoming record payload length is 4096" \ |
| 4363 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4364 | -c "client hello, adding max_fragment_length extension" \ |
| 4365 | -s "found max fragment length extension" \ |
| 4366 | -s "server hello, max_fragment_length extension" \ |
| 4367 | -c "found max_fragment_length extension" |
| 4368 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4369 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4370 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4372 | run_test "Max fragment length: client 512, server 1024" \ |
| 4373 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4374 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4375 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4376 | -c "Maximum incoming record payload length is 512" \ |
| 4377 | -c "Maximum outgoing record payload length is 512" \ |
| 4378 | -s "Maximum incoming record payload length is 512" \ |
| 4379 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4380 | -c "client hello, adding max_fragment_length extension" \ |
| 4381 | -s "found max fragment length extension" \ |
| 4382 | -s "server hello, max_fragment_length extension" \ |
| 4383 | -c "found max_fragment_length extension" |
| 4384 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4385 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4386 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4388 | run_test "Max fragment length: client 512, server 2048" \ |
| 4389 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4390 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4391 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4392 | -c "Maximum incoming record payload length is 512" \ |
| 4393 | -c "Maximum outgoing record payload length is 512" \ |
| 4394 | -s "Maximum incoming record payload length is 512" \ |
| 4395 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4396 | -c "client hello, adding max_fragment_length extension" \ |
| 4397 | -s "found max fragment length extension" \ |
| 4398 | -s "server hello, max_fragment_length extension" \ |
| 4399 | -c "found max_fragment_length extension" |
| 4400 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4401 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4402 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4403 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4404 | run_test "Max fragment length: client 512, server 4096" \ |
| 4405 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4406 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 4407 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4408 | -c "Maximum incoming record payload length is 512" \ |
| 4409 | -c "Maximum outgoing record payload length is 512" \ |
| 4410 | -s "Maximum incoming record payload length is 512" \ |
| 4411 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4412 | -c "client hello, adding max_fragment_length extension" \ |
| 4413 | -s "found max fragment length extension" \ |
| 4414 | -s "server hello, max_fragment_length extension" \ |
| 4415 | -c "found max_fragment_length extension" |
| 4416 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4417 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4420 | run_test "Max fragment length: client 1024, server 512" \ |
| 4421 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4422 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4423 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4424 | -c "Maximum incoming record payload length is 1024" \ |
| 4425 | -c "Maximum outgoing record payload length is 1024" \ |
| 4426 | -s "Maximum incoming record payload length is 1024" \ |
| 4427 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4428 | -c "client hello, adding max_fragment_length extension" \ |
| 4429 | -s "found max fragment length extension" \ |
| 4430 | -s "server hello, max_fragment_length extension" \ |
| 4431 | -c "found max_fragment_length extension" |
| 4432 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4433 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4434 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4436 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4437 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4438 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4439 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4440 | -c "Maximum incoming record payload length is 1024" \ |
| 4441 | -c "Maximum outgoing record payload length is 1024" \ |
| 4442 | -s "Maximum incoming record payload length is 1024" \ |
| 4443 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4444 | -c "client hello, adding max_fragment_length extension" \ |
| 4445 | -s "found max fragment length extension" \ |
| 4446 | -s "server hello, max_fragment_length extension" \ |
| 4447 | -c "found max_fragment_length extension" |
| 4448 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4449 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4452 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4453 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4454 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4455 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4456 | -c "Maximum incoming record payload length is 1024" \ |
| 4457 | -c "Maximum outgoing record payload length is 1024" \ |
| 4458 | -s "Maximum incoming record payload length is 1024" \ |
| 4459 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4460 | -c "client hello, adding max_fragment_length extension" \ |
| 4461 | -s "found max fragment length extension" \ |
| 4462 | -s "server hello, max_fragment_length extension" \ |
| 4463 | -c "found max_fragment_length extension" |
| 4464 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4465 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4466 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4468 | run_test "Max fragment length: client 2048, server 512" \ |
| 4469 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4470 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4471 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4472 | -c "Maximum incoming record payload length is 2048" \ |
| 4473 | -c "Maximum outgoing record payload length is 2048" \ |
| 4474 | -s "Maximum incoming record payload length is 2048" \ |
| 4475 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4476 | -c "client hello, adding max_fragment_length extension" \ |
| 4477 | -s "found max fragment length extension" \ |
| 4478 | -s "server hello, max_fragment_length extension" \ |
| 4479 | -c "found max_fragment_length extension" |
| 4480 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4481 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4482 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4484 | run_test "Max fragment length: client 2048, server 1024" \ |
| 4485 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4486 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4487 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4488 | -c "Maximum incoming record payload length is 2048" \ |
| 4489 | -c "Maximum outgoing record payload length is 2048" \ |
| 4490 | -s "Maximum incoming record payload length is 2048" \ |
| 4491 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4492 | -c "client hello, adding max_fragment_length extension" \ |
| 4493 | -s "found max fragment length extension" \ |
| 4494 | -s "server hello, max_fragment_length extension" \ |
| 4495 | -c "found max_fragment_length extension" |
| 4496 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4497 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4500 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4501 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4502 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4503 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4504 | -c "Maximum incoming record payload length is 2048" \ |
| 4505 | -c "Maximum outgoing record payload length is 2048" \ |
| 4506 | -s "Maximum incoming record payload length is 2048" \ |
| 4507 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4508 | -c "client hello, adding max_fragment_length extension" \ |
| 4509 | -s "found max fragment length extension" \ |
| 4510 | -s "server hello, max_fragment_length extension" \ |
| 4511 | -c "found max_fragment_length extension" |
| 4512 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4513 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4514 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4516 | run_test "Max fragment length: client 4096, server 512" \ |
| 4517 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 4518 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4519 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4520 | -c "Maximum incoming record payload length is 4096" \ |
| 4521 | -c "Maximum outgoing record payload length is 4096" \ |
| 4522 | -s "Maximum incoming record payload length is 4096" \ |
| 4523 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4524 | -c "client hello, adding max_fragment_length extension" \ |
| 4525 | -s "found max fragment length extension" \ |
| 4526 | -s "server hello, max_fragment_length extension" \ |
| 4527 | -c "found max_fragment_length extension" |
| 4528 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4529 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4530 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4532 | run_test "Max fragment length: client 4096, server 1024" \ |
| 4533 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 4534 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4535 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4536 | -c "Maximum incoming record payload length is 4096" \ |
| 4537 | -c "Maximum outgoing record payload length is 4096" \ |
| 4538 | -s "Maximum incoming record payload length is 4096" \ |
| 4539 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4540 | -c "client hello, adding max_fragment_length extension" \ |
| 4541 | -s "found max fragment length extension" \ |
| 4542 | -s "server hello, max_fragment_length extension" \ |
| 4543 | -c "found max_fragment_length extension" |
| 4544 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4545 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4546 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4548 | run_test "Max fragment length: client 4096, server 2048" \ |
| 4549 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 4550 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4551 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4552 | -c "Maximum incoming record payload length is 4096" \ |
| 4553 | -c "Maximum outgoing record payload length is 4096" \ |
| 4554 | -s "Maximum incoming record payload length is 4096" \ |
| 4555 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4556 | -c "client hello, adding max_fragment_length extension" \ |
| 4557 | -s "found max fragment length extension" \ |
| 4558 | -s "server hello, max_fragment_length extension" \ |
| 4559 | -c "found max_fragment_length extension" |
| 4560 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4561 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4562 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4564 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4565 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 4566 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4567 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4568 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4569 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4570 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4571 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4572 | -C "client hello, adding max_fragment_length extension" \ |
| 4573 | -S "found max fragment length extension" \ |
| 4574 | -S "server hello, max_fragment_length extension" \ |
| 4575 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4576 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4577 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4579 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4581 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4582 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4583 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4584 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4585 | -c "Maximum incoming record payload length is 4096" \ |
| 4586 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4587 | -c "client hello, adding max_fragment_length extension" \ |
| 4588 | -c "found max_fragment_length extension" |
| 4589 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4590 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4591 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4593 | run_test "Max fragment length: client, message just fits" \ |
| 4594 | "$P_SRV debug_level=3" \ |
| 4595 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 4596 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4597 | -c "Maximum incoming record payload length is 2048" \ |
| 4598 | -c "Maximum outgoing record payload length is 2048" \ |
| 4599 | -s "Maximum incoming record payload length is 2048" \ |
| 4600 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4601 | -c "client hello, adding max_fragment_length extension" \ |
| 4602 | -s "found max fragment length extension" \ |
| 4603 | -s "server hello, max_fragment_length extension" \ |
| 4604 | -c "found max_fragment_length extension" \ |
| 4605 | -c "2048 bytes written in 1 fragments" \ |
| 4606 | -s "2048 bytes read" |
| 4607 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4608 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4609 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4610 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4611 | run_test "Max fragment length: client, larger message" \ |
| 4612 | "$P_SRV debug_level=3" \ |
| 4613 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 4614 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4615 | -c "Maximum incoming record payload length is 2048" \ |
| 4616 | -c "Maximum outgoing record payload length is 2048" \ |
| 4617 | -s "Maximum incoming record payload length is 2048" \ |
| 4618 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4619 | -c "client hello, adding max_fragment_length extension" \ |
| 4620 | -s "found max fragment length extension" \ |
| 4621 | -s "server hello, max_fragment_length extension" \ |
| 4622 | -c "found max_fragment_length extension" \ |
| 4623 | -c "2345 bytes written in 2 fragments" \ |
| 4624 | -s "2048 bytes read" \ |
| 4625 | -s "297 bytes read" |
| 4626 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4627 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4628 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4630 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4631 | "$P_SRV debug_level=3 dtls=1" \ |
| 4632 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4633 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4634 | -c "Maximum incoming record payload length is 2048" \ |
| 4635 | -c "Maximum outgoing record payload length is 2048" \ |
| 4636 | -s "Maximum incoming record payload length is 2048" \ |
| 4637 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4638 | -c "client hello, adding max_fragment_length extension" \ |
| 4639 | -s "found max fragment length extension" \ |
| 4640 | -s "server hello, max_fragment_length extension" \ |
| 4641 | -c "found max_fragment_length extension" \ |
| 4642 | -c "fragment larger than.*maximum" |
| 4643 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4644 | # Tests for renegotiation |
| 4645 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4646 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4648 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4649 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4650 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4651 | 0 \ |
| 4652 | -C "client hello, adding renegotiation extension" \ |
| 4653 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4654 | -S "found renegotiation extension" \ |
| 4655 | -s "server hello, secure renegotiation extension" \ |
| 4656 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4657 | -C "=> renegotiate" \ |
| 4658 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4659 | -S "write hello request" |
| 4660 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4661 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4663 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4664 | "$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] | 4665 | "$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] | 4666 | 0 \ |
| 4667 | -c "client hello, adding renegotiation extension" \ |
| 4668 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4669 | -s "found renegotiation extension" \ |
| 4670 | -s "server hello, secure renegotiation extension" \ |
| 4671 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4672 | -c "=> renegotiate" \ |
| 4673 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4674 | -S "write hello request" |
| 4675 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4678 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4679 | "$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] | 4680 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4681 | 0 \ |
| 4682 | -c "client hello, adding renegotiation extension" \ |
| 4683 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4684 | -s "found renegotiation extension" \ |
| 4685 | -s "server hello, secure renegotiation extension" \ |
| 4686 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4687 | -c "=> renegotiate" \ |
| 4688 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4689 | -s "write hello request" |
| 4690 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4691 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4692 | # 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] | 4693 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4696 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4697 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 4698 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4699 | 0 \ |
| 4700 | -c "client hello, adding renegotiation extension" \ |
| 4701 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4702 | -s "found renegotiation extension" \ |
| 4703 | -s "server hello, secure renegotiation extension" \ |
| 4704 | -c "found renegotiation extension" \ |
| 4705 | -c "=> renegotiate" \ |
| 4706 | -s "=> renegotiate" \ |
| 4707 | -S "write hello request" \ |
| 4708 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4709 | |
| 4710 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4711 | # 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] | 4712 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4715 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 4716 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 4717 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4718 | 0 \ |
| 4719 | -c "client hello, adding renegotiation extension" \ |
| 4720 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4721 | -s "found renegotiation extension" \ |
| 4722 | -s "server hello, secure renegotiation extension" \ |
| 4723 | -c "found renegotiation extension" \ |
| 4724 | -c "=> renegotiate" \ |
| 4725 | -s "=> renegotiate" \ |
| 4726 | -s "write hello request" \ |
| 4727 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4728 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4730 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4731 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4732 | "$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] | 4733 | "$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] | 4734 | 0 \ |
| 4735 | -c "client hello, adding renegotiation extension" \ |
| 4736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4737 | -s "found renegotiation extension" \ |
| 4738 | -s "server hello, secure renegotiation extension" \ |
| 4739 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4740 | -c "=> renegotiate" \ |
| 4741 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4742 | -s "write hello request" |
| 4743 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4744 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4745 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4746 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4748 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 4749 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 4750 | "$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" \ |
| 4751 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4752 | -c "Maximum incoming record payload length is 2048" \ |
| 4753 | -c "Maximum outgoing record payload length is 2048" \ |
| 4754 | -s "Maximum incoming record payload length is 2048" \ |
| 4755 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4756 | -c "client hello, adding max_fragment_length extension" \ |
| 4757 | -s "found max fragment length extension" \ |
| 4758 | -s "server hello, max_fragment_length extension" \ |
| 4759 | -c "found max_fragment_length extension" \ |
| 4760 | -c "client hello, adding renegotiation extension" \ |
| 4761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4762 | -s "found renegotiation extension" \ |
| 4763 | -s "server hello, secure renegotiation extension" \ |
| 4764 | -c "found renegotiation extension" \ |
| 4765 | -c "=> renegotiate" \ |
| 4766 | -s "=> renegotiate" \ |
| 4767 | -s "write hello request" |
| 4768 | |
| 4769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4771 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4772 | "$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] | 4773 | "$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] | 4774 | 1 \ |
| 4775 | -c "client hello, adding renegotiation extension" \ |
| 4776 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4777 | -S "found renegotiation extension" \ |
| 4778 | -s "server hello, secure renegotiation extension" \ |
| 4779 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4780 | -c "=> renegotiate" \ |
| 4781 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4782 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4783 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4784 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4785 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4788 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4789 | "$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] | 4790 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4791 | 0 \ |
| 4792 | -C "client hello, adding renegotiation extension" \ |
| 4793 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4794 | -S "found renegotiation extension" \ |
| 4795 | -s "server hello, secure renegotiation extension" \ |
| 4796 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4797 | -C "=> renegotiate" \ |
| 4798 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4799 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4800 | -S "SSL - An unexpected message was received from our peer" \ |
| 4801 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4802 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4805 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4806 | "$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] | 4807 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4808 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4809 | 0 \ |
| 4810 | -C "client hello, adding renegotiation extension" \ |
| 4811 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4812 | -S "found renegotiation extension" \ |
| 4813 | -s "server hello, secure renegotiation extension" \ |
| 4814 | -c "found renegotiation extension" \ |
| 4815 | -C "=> renegotiate" \ |
| 4816 | -S "=> renegotiate" \ |
| 4817 | -s "write hello request" \ |
| 4818 | -S "SSL - An unexpected message was received from our peer" \ |
| 4819 | -S "failed" |
| 4820 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4821 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4824 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4825 | "$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] | 4826 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4827 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4828 | 0 \ |
| 4829 | -C "client hello, adding renegotiation extension" \ |
| 4830 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4831 | -S "found renegotiation extension" \ |
| 4832 | -s "server hello, secure renegotiation extension" \ |
| 4833 | -c "found renegotiation extension" \ |
| 4834 | -C "=> renegotiate" \ |
| 4835 | -S "=> renegotiate" \ |
| 4836 | -s "write hello request" \ |
| 4837 | -S "SSL - An unexpected message was received from our peer" \ |
| 4838 | -S "failed" |
| 4839 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4840 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4842 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4843 | "$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] | 4844 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4845 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4846 | 0 \ |
| 4847 | -C "client hello, adding renegotiation extension" \ |
| 4848 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4849 | -S "found renegotiation extension" \ |
| 4850 | -s "server hello, secure renegotiation extension" \ |
| 4851 | -c "found renegotiation extension" \ |
| 4852 | -C "=> renegotiate" \ |
| 4853 | -S "=> renegotiate" \ |
| 4854 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4855 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4856 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4859 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4860 | "$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] | 4861 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4862 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4863 | 0 \ |
| 4864 | -c "client hello, adding renegotiation extension" \ |
| 4865 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4866 | -s "found renegotiation extension" \ |
| 4867 | -s "server hello, secure renegotiation extension" \ |
| 4868 | -c "found renegotiation extension" \ |
| 4869 | -c "=> renegotiate" \ |
| 4870 | -s "=> renegotiate" \ |
| 4871 | -s "write hello request" \ |
| 4872 | -S "SSL - An unexpected message was received from our peer" \ |
| 4873 | -S "failed" |
| 4874 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4876 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4877 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4878 | "$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] | 4879 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4880 | 0 \ |
| 4881 | -C "client hello, adding renegotiation extension" \ |
| 4882 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4883 | -S "found renegotiation extension" \ |
| 4884 | -s "server hello, secure renegotiation extension" \ |
| 4885 | -c "found renegotiation extension" \ |
| 4886 | -S "record counter limit reached: renegotiate" \ |
| 4887 | -C "=> renegotiate" \ |
| 4888 | -S "=> renegotiate" \ |
| 4889 | -S "write hello request" \ |
| 4890 | -S "SSL - An unexpected message was received from our peer" \ |
| 4891 | -S "failed" |
| 4892 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4893 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4894 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4896 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4897 | "$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] | 4898 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4899 | 0 \ |
| 4900 | -c "client hello, adding renegotiation extension" \ |
| 4901 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4902 | -s "found renegotiation extension" \ |
| 4903 | -s "server hello, secure renegotiation extension" \ |
| 4904 | -c "found renegotiation extension" \ |
| 4905 | -s "record counter limit reached: renegotiate" \ |
| 4906 | -c "=> renegotiate" \ |
| 4907 | -s "=> renegotiate" \ |
| 4908 | -s "write hello request" \ |
| 4909 | -S "SSL - An unexpected message was received from our peer" \ |
| 4910 | -S "failed" |
| 4911 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4912 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4914 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4915 | "$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] | 4916 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4917 | 0 \ |
| 4918 | -c "client hello, adding renegotiation extension" \ |
| 4919 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4920 | -s "found renegotiation extension" \ |
| 4921 | -s "server hello, secure renegotiation extension" \ |
| 4922 | -c "found renegotiation extension" \ |
| 4923 | -s "record counter limit reached: renegotiate" \ |
| 4924 | -c "=> renegotiate" \ |
| 4925 | -s "=> renegotiate" \ |
| 4926 | -s "write hello request" \ |
| 4927 | -S "SSL - An unexpected message was received from our peer" \ |
| 4928 | -S "failed" |
| 4929 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4930 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4932 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4933 | "$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] | 4934 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4935 | 0 \ |
| 4936 | -C "client hello, adding renegotiation extension" \ |
| 4937 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4938 | -S "found renegotiation extension" \ |
| 4939 | -s "server hello, secure renegotiation extension" \ |
| 4940 | -c "found renegotiation extension" \ |
| 4941 | -S "record counter limit reached: renegotiate" \ |
| 4942 | -C "=> renegotiate" \ |
| 4943 | -S "=> renegotiate" \ |
| 4944 | -S "write hello request" \ |
| 4945 | -S "SSL - An unexpected message was received from our peer" \ |
| 4946 | -S "failed" |
| 4947 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4948 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4950 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4951 | "$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] | 4952 | "$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] | 4953 | 0 \ |
| 4954 | -c "client hello, adding renegotiation extension" \ |
| 4955 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4956 | -s "found renegotiation extension" \ |
| 4957 | -s "server hello, secure renegotiation extension" \ |
| 4958 | -c "found renegotiation extension" \ |
| 4959 | -c "=> renegotiate" \ |
| 4960 | -s "=> renegotiate" \ |
| 4961 | -S "write hello request" |
| 4962 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4965 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4966 | "$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] | 4967 | "$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] | 4968 | 0 \ |
| 4969 | -c "client hello, adding renegotiation extension" \ |
| 4970 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4971 | -s "found renegotiation extension" \ |
| 4972 | -s "server hello, secure renegotiation extension" \ |
| 4973 | -c "found renegotiation extension" \ |
| 4974 | -c "=> renegotiate" \ |
| 4975 | -s "=> renegotiate" \ |
| 4976 | -s "write hello request" |
| 4977 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4978 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4980 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4981 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4982 | "$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] | 4983 | 0 \ |
| 4984 | -c "client hello, adding renegotiation extension" \ |
| 4985 | -c "found renegotiation extension" \ |
| 4986 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4987 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4988 | -C "error" \ |
| 4989 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4990 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4991 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4993 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4994 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4995 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4996 | "$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] | 4997 | 0 \ |
| 4998 | -c "client hello, adding renegotiation extension" \ |
| 4999 | -c "found renegotiation extension" \ |
| 5000 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5001 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5002 | -C "error" \ |
| 5003 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5004 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5005 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5006 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5008 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5009 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5010 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5011 | 1 \ |
| 5012 | -c "client hello, adding renegotiation extension" \ |
| 5013 | -C "found renegotiation extension" \ |
| 5014 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5015 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5016 | -c "error" \ |
| 5017 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5018 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5019 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5022 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5023 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5024 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5025 | allow_legacy=0" \ |
| 5026 | 1 \ |
| 5027 | -c "client hello, adding renegotiation extension" \ |
| 5028 | -C "found renegotiation extension" \ |
| 5029 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5030 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5031 | -c "error" \ |
| 5032 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5033 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5034 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5035 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5037 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5038 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5039 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5040 | allow_legacy=1" \ |
| 5041 | 0 \ |
| 5042 | -c "client hello, adding renegotiation extension" \ |
| 5043 | -C "found renegotiation extension" \ |
| 5044 | -c "=> renegotiate" \ |
| 5045 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5046 | -C "error" \ |
| 5047 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5048 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5049 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5051 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5052 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5053 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5054 | 0 \ |
| 5055 | -c "client hello, adding renegotiation extension" \ |
| 5056 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5057 | -s "found renegotiation extension" \ |
| 5058 | -s "server hello, secure renegotiation extension" \ |
| 5059 | -c "found renegotiation extension" \ |
| 5060 | -c "=> renegotiate" \ |
| 5061 | -s "=> renegotiate" \ |
| 5062 | -S "write hello request" |
| 5063 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5064 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5065 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5066 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5067 | "$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] | 5068 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5069 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5070 | 0 \ |
| 5071 | -c "client hello, adding renegotiation extension" \ |
| 5072 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5073 | -s "found renegotiation extension" \ |
| 5074 | -s "server hello, secure renegotiation extension" \ |
| 5075 | -c "found renegotiation extension" \ |
| 5076 | -c "=> renegotiate" \ |
| 5077 | -s "=> renegotiate" \ |
| 5078 | -s "write hello request" |
| 5079 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5080 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5082 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5083 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5084 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5085 | 0 \ |
| 5086 | -c "client hello, adding renegotiation extension" \ |
| 5087 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5088 | -s "found renegotiation extension" \ |
| 5089 | -s "server hello, secure renegotiation extension" \ |
| 5090 | -s "record counter limit reached: renegotiate" \ |
| 5091 | -c "=> renegotiate" \ |
| 5092 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5093 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5094 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5095 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5096 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5098 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5099 | "$G_SRV -u --mtu 4096" \ |
| 5100 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5101 | 0 \ |
| 5102 | -c "client hello, adding renegotiation extension" \ |
| 5103 | -c "found renegotiation extension" \ |
| 5104 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5105 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5106 | -C "error" \ |
| 5107 | -s "Extra-header:" |
| 5108 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5109 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5110 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5111 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5112 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5113 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5114 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5115 | "$P_CLI debug_level=3" \ |
| 5116 | 0 \ |
| 5117 | -c "found renegotiation extension" \ |
| 5118 | -C "error" \ |
| 5119 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5120 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5121 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5122 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5123 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5124 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5125 | "$P_CLI debug_level=3" \ |
| 5126 | 0 \ |
| 5127 | -C "found renegotiation extension" \ |
| 5128 | -C "error" \ |
| 5129 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5130 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5131 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5133 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5134 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5135 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5136 | 1 \ |
| 5137 | -C "found renegotiation extension" \ |
| 5138 | -c "error" \ |
| 5139 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5140 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5141 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5143 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5144 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5145 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5146 | 0 \ |
| 5147 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5148 | -s "server hello, secure renegotiation extension" |
| 5149 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5150 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5152 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5153 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5154 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5155 | 0 \ |
| 5156 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5157 | -S "server hello, secure renegotiation extension" |
| 5158 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5159 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5161 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5162 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5163 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5164 | 1 \ |
| 5165 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5166 | -S "server hello, secure renegotiation extension" |
| 5167 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5168 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5169 | |
| 5170 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5172 | run_test "DER format: no trailing bytes" \ |
| 5173 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5174 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5175 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5176 | 0 \ |
| 5177 | -c "Handshake was completed" \ |
| 5178 | |
| 5179 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5180 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5181 | run_test "DER format: with a trailing zero byte" \ |
| 5182 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5183 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5184 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5185 | 0 \ |
| 5186 | -c "Handshake was completed" \ |
| 5187 | |
| 5188 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5190 | run_test "DER format: with a trailing random byte" \ |
| 5191 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5192 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5193 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5194 | 0 \ |
| 5195 | -c "Handshake was completed" \ |
| 5196 | |
| 5197 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5199 | run_test "DER format: with 2 trailing random bytes" \ |
| 5200 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5201 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5202 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5203 | 0 \ |
| 5204 | -c "Handshake was completed" \ |
| 5205 | |
| 5206 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5208 | run_test "DER format: with 4 trailing random bytes" \ |
| 5209 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5210 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5211 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5212 | 0 \ |
| 5213 | -c "Handshake was completed" \ |
| 5214 | |
| 5215 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5216 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5217 | run_test "DER format: with 8 trailing random bytes" \ |
| 5218 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5219 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5220 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5221 | 0 \ |
| 5222 | -c "Handshake was completed" \ |
| 5223 | |
| 5224 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5226 | run_test "DER format: with 9 trailing random bytes" \ |
| 5227 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5228 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5229 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5230 | 0 \ |
| 5231 | -c "Handshake was completed" \ |
| 5232 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5233 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5234 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5235 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5236 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5237 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5238 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5239 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5240 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5241 | 1 \ |
| 5242 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5243 | -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] | 5244 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5245 | -c "X509 - Certificate verification failed" |
| 5246 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5248 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5249 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5250 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5251 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5252 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5253 | 0 \ |
| 5254 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5255 | -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] | 5256 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5257 | -C "X509 - Certificate verification failed" |
| 5258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5260 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5261 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5262 | "$P_SRV" \ |
| 5263 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 5264 | 0 \ |
| 5265 | -c "x509_verify_cert() returned" \ |
| 5266 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5267 | -c "! Certificate verification flags"\ |
| 5268 | -C "! mbedtls_ssl_handshake returned" \ |
| 5269 | -C "X509 - Certificate verification failed" \ |
| 5270 | -C "SSL - No CA Chain is set, but required to operate" |
| 5271 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5272 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5273 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5274 | "$P_SRV" \ |
| 5275 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5276 | 1 \ |
| 5277 | -c "x509_verify_cert() returned" \ |
| 5278 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5279 | -c "! Certificate verification flags"\ |
| 5280 | -c "! mbedtls_ssl_handshake returned" \ |
| 5281 | -c "SSL - No CA Chain is set, but required to operate" |
| 5282 | |
| 5283 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5284 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5285 | # the client informs the server about the supported curves - it does, though, in the |
| 5286 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5287 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5288 | # different means to have the server ignoring the client's supported curve list. |
| 5289 | |
| 5290 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5291 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5292 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5293 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5294 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5295 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5296 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5297 | 1 \ |
| 5298 | -c "bad certificate (EC key curve)"\ |
| 5299 | -c "! Certificate verification flags"\ |
| 5300 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5301 | |
| 5302 | requires_config_enabled MBEDTLS_ECP_C |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5303 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5304 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5305 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5306 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5307 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5308 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5309 | 1 \ |
| 5310 | -c "bad certificate (EC key curve)"\ |
| 5311 | -c "! Certificate verification flags"\ |
| 5312 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5313 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5314 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5315 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5316 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5317 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5318 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5319 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5320 | 0 \ |
| 5321 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5322 | -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] | 5323 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5324 | -C "X509 - Certificate verification failed" |
| 5325 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5327 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5328 | run_test "Authentication: client SHA256, server required" \ |
| 5329 | "$P_SRV auth_mode=required" \ |
| 5330 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5331 | key_file=data_files/server6.key \ |
| 5332 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5333 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5334 | -c "Supported Signature Algorithm found: 04 " \ |
| 5335 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5338 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5339 | run_test "Authentication: client SHA384, server required" \ |
| 5340 | "$P_SRV auth_mode=required" \ |
| 5341 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5342 | key_file=data_files/server6.key \ |
| 5343 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5344 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5345 | -c "Supported Signature Algorithm found: 04 " \ |
| 5346 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5347 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5348 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5349 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5350 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5351 | "$P_CLI debug_level=3 crt_file=none \ |
| 5352 | key_file=data_files/server5.key" \ |
| 5353 | 1 \ |
| 5354 | -S "skip write certificate request" \ |
| 5355 | -C "skip parse certificate request" \ |
| 5356 | -c "got a certificate request" \ |
| 5357 | -c "= write certificate$" \ |
| 5358 | -C "skip write certificate$" \ |
| 5359 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5360 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5361 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5362 | -s "No client certification received from the client, but required by the authentication mode" |
| 5363 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5364 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5365 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5366 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5367 | "$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] | 5368 | key_file=data_files/server5.key" \ |
| 5369 | 1 \ |
| 5370 | -S "skip write certificate request" \ |
| 5371 | -C "skip parse certificate request" \ |
| 5372 | -c "got a certificate request" \ |
| 5373 | -C "skip write certificate" \ |
| 5374 | -C "skip write certificate verify" \ |
| 5375 | -S "skip parse certificate verify" \ |
| 5376 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5377 | -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] | 5378 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5379 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5380 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5381 | # We don't check that the client receives the alert because it might |
| 5382 | # detect that its write end of the connection is closed and abort |
| 5383 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5384 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5385 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5386 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5387 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5388 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5389 | key_file=data_files/server5.key" \ |
| 5390 | 0 \ |
| 5391 | -S "skip write certificate request" \ |
| 5392 | -C "skip parse certificate request" \ |
| 5393 | -c "got a certificate request" \ |
| 5394 | -C "skip write certificate" \ |
| 5395 | -C "skip write certificate verify" \ |
| 5396 | -S "skip parse certificate verify" \ |
| 5397 | -S "x509_verify_cert() returned" \ |
| 5398 | -S "! The certificate is not correctly signed" \ |
| 5399 | -S "X509 - Certificate verification failed" |
| 5400 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5401 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5402 | run_test "Authentication: client cert not trusted, server required" \ |
| 5403 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5404 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5405 | key_file=data_files/server5.key" \ |
| 5406 | 1 \ |
| 5407 | -S "skip write certificate request" \ |
| 5408 | -C "skip parse certificate request" \ |
| 5409 | -c "got a certificate request" \ |
| 5410 | -C "skip write certificate" \ |
| 5411 | -C "skip write certificate verify" \ |
| 5412 | -S "skip parse certificate verify" \ |
| 5413 | -s "x509_verify_cert() returned" \ |
| 5414 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5415 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5416 | -s "X509 - Certificate verification failed" |
| 5417 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5418 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5419 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5420 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5421 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5422 | key_file=data_files/server5.key" \ |
| 5423 | 0 \ |
| 5424 | -S "skip write certificate request" \ |
| 5425 | -C "skip parse certificate request" \ |
| 5426 | -c "got a certificate request" \ |
| 5427 | -C "skip write certificate" \ |
| 5428 | -C "skip write certificate verify" \ |
| 5429 | -S "skip parse certificate verify" \ |
| 5430 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5431 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5432 | -S "! mbedtls_ssl_handshake returned" \ |
| 5433 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5434 | -S "X509 - Certificate verification failed" |
| 5435 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5436 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5437 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5438 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5439 | "$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] | 5440 | key_file=data_files/server5.key" \ |
| 5441 | 0 \ |
| 5442 | -s "skip write certificate request" \ |
| 5443 | -C "skip parse certificate request" \ |
| 5444 | -c "got no certificate request" \ |
| 5445 | -c "skip write certificate" \ |
| 5446 | -c "skip write certificate verify" \ |
| 5447 | -s "skip parse certificate verify" \ |
| 5448 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5449 | -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] | 5450 | -S "! mbedtls_ssl_handshake returned" \ |
| 5451 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5452 | -S "X509 - Certificate verification failed" |
| 5453 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5454 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5455 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5456 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5457 | "$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] | 5458 | 0 \ |
| 5459 | -S "skip write certificate request" \ |
| 5460 | -C "skip parse certificate request" \ |
| 5461 | -c "got a certificate request" \ |
| 5462 | -C "skip write certificate$" \ |
| 5463 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5464 | -c "skip write certificate verify" \ |
| 5465 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5466 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5467 | -S "! mbedtls_ssl_handshake returned" \ |
| 5468 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5469 | -S "X509 - Certificate verification failed" |
| 5470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5472 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5473 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5474 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5475 | "$O_CLI" \ |
| 5476 | 0 \ |
| 5477 | -S "skip write certificate request" \ |
| 5478 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5479 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5480 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5481 | -S "X509 - Certificate verification failed" |
| 5482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5484 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5485 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5486 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5487 | "$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] | 5488 | 0 \ |
| 5489 | -C "skip parse certificate request" \ |
| 5490 | -c "got a certificate request" \ |
| 5491 | -C "skip write certificate$" \ |
| 5492 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5493 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5494 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5496 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5497 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5498 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5499 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5500 | 1 \ |
| 5501 | -C "skip parse certificate request" \ |
| 5502 | -c "got a certificate request" \ |
| 5503 | -C "skip write certificate$" \ |
| 5504 | -c "skip write certificate verify" \ |
| 5505 | -c "! mbedtls_ssl_handshake returned" |
| 5506 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5507 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5508 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5509 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5510 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5511 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5512 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5513 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5514 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5515 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5516 | # 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] | 5517 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5518 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5519 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5520 | run_test "Authentication: server max_int chain, client default" \ |
| 5521 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5522 | key_file=data_files/dir-maxpath/09.key" \ |
| 5523 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5524 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5525 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5526 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5527 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5528 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5529 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5530 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5531 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5532 | key_file=data_files/dir-maxpath/10.key" \ |
| 5533 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5534 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5535 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5536 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5537 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5538 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5540 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5541 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5542 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5543 | key_file=data_files/dir-maxpath/10.key" \ |
| 5544 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5545 | auth_mode=optional" \ |
| 5546 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5547 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5548 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5549 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5550 | requires_full_size_output_buffer |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5551 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5552 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5553 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5554 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5555 | key_file=data_files/dir-maxpath/10.key" \ |
| 5556 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5557 | auth_mode=none" \ |
| 5558 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5559 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5560 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5561 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5562 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5563 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5564 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5565 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5566 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5567 | key_file=data_files/dir-maxpath/10.key" \ |
| 5568 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5569 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5570 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5571 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5572 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5573 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5574 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5575 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5576 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5577 | key_file=data_files/dir-maxpath/10.key" \ |
| 5578 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5579 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5580 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5581 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5582 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5583 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5584 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5585 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5586 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5587 | key_file=data_files/dir-maxpath/10.key" \ |
| 5588 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5589 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5590 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5591 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5592 | requires_full_size_output_buffer |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5593 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5594 | run_test "Authentication: client max_int chain, server required" \ |
| 5595 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5596 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5597 | key_file=data_files/dir-maxpath/09.key" \ |
| 5598 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5599 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5600 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5601 | # Tests for CA list in CertificateRequest messages |
| 5602 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5603 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5604 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5605 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5606 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5607 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5608 | key_file=data_files/server6.key" \ |
| 5609 | 0 \ |
| 5610 | -s "requested DN" |
| 5611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5613 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5614 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5615 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5616 | "$P_CLI crt_file=data_files/server6.crt \ |
| 5617 | key_file=data_files/server6.key" \ |
| 5618 | 0 \ |
| 5619 | -S "requested DN" |
| 5620 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5622 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5623 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 5624 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 5625 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5626 | key_file=data_files/server5.key" \ |
| 5627 | 1 \ |
| 5628 | -S "requested DN" \ |
| 5629 | -s "x509_verify_cert() returned" \ |
| 5630 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5631 | -s "! mbedtls_ssl_handshake returned" \ |
| 5632 | -c "! mbedtls_ssl_handshake returned" \ |
| 5633 | -s "X509 - Certificate verification failed" |
| 5634 | |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5636 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5637 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5638 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5639 | crt_file2=data_files/server1.crt \ |
| 5640 | key_file2=data_files/server1.key" \ |
| 5641 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5642 | crt_file=data_files/server6.crt \ |
| 5643 | key_file=data_files/server6.key" \ |
| 5644 | 0 \ |
| 5645 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5646 | |
| 5647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5648 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5649 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5650 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5651 | crt_file2=data_files/server2.crt \ |
| 5652 | key_file2=data_files/server2.key" \ |
| 5653 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5654 | crt_file=data_files/server6.crt \ |
| 5655 | key_file=data_files/server6.key" \ |
| 5656 | 0 \ |
| 5657 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5658 | |
| 5659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5660 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5661 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5662 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5663 | crt_file2=data_files/server1.crt \ |
| 5664 | key_file2=data_files/server1.key" \ |
| 5665 | "$P_CLI debug_level=3 auth_mode=optional \ |
| 5666 | crt_file=data_files/server6.crt \ |
| 5667 | key_file=data_files/server6.key" \ |
| 5668 | 0 \ |
| 5669 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5670 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5671 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5672 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5673 | |
| 5674 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5676 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5677 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5678 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5679 | key_file=data_files/server5.key" \ |
| 5680 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5681 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5682 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5683 | -c "x509_verify_cert() returned" \ |
| 5684 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5685 | -c "! mbedtls_ssl_handshake returned" \ |
| 5686 | -c "X509 - Certificate verification failed" |
| 5687 | |
| 5688 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5690 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5691 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5692 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5693 | key_file=data_files/server5.key" \ |
| 5694 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5695 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5696 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5697 | -c "x509_verify_cert() returned" \ |
| 5698 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5699 | -C "! mbedtls_ssl_handshake returned" \ |
| 5700 | -C "X509 - Certificate verification failed" |
| 5701 | |
| 5702 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5703 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5704 | # the client informs the server about the supported curves - it does, though, in the |
| 5705 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5706 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5707 | # different means to have the server ignoring the client's supported curve list. |
| 5708 | |
| 5709 | requires_config_enabled MBEDTLS_ECP_C |
| 5710 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5712 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5713 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5714 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5715 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5716 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 5717 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5718 | -c "use CA callback for X.509 CRT verification" \ |
| 5719 | -c "bad certificate (EC key curve)" \ |
| 5720 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5721 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5722 | |
| 5723 | requires_config_enabled MBEDTLS_ECP_C |
| 5724 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5726 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5727 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5728 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5729 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5730 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 5731 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5732 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5733 | -c "bad certificate (EC key curve)"\ |
| 5734 | -c "! Certificate verification flags"\ |
| 5735 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5736 | |
| 5737 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5739 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5740 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5741 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5742 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5743 | key_file=data_files/server6.key \ |
| 5744 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5745 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5746 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5747 | -c "Supported Signature Algorithm found: 04 " \ |
| 5748 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5749 | |
| 5750 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5752 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5753 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5754 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5755 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5756 | key_file=data_files/server6.key \ |
| 5757 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5758 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5759 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5760 | -c "Supported Signature Algorithm found: 04 " \ |
| 5761 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5762 | |
| 5763 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5765 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5766 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 5767 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5768 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5769 | key_file=data_files/server5.key" \ |
| 5770 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5771 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5772 | -S "skip write certificate request" \ |
| 5773 | -C "skip parse certificate request" \ |
| 5774 | -c "got a certificate request" \ |
| 5775 | -C "skip write certificate" \ |
| 5776 | -C "skip write certificate verify" \ |
| 5777 | -S "skip parse certificate verify" \ |
| 5778 | -s "x509_verify_cert() returned" \ |
| 5779 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5780 | -s "! mbedtls_ssl_handshake returned" \ |
| 5781 | -s "send alert level=2 message=48" \ |
| 5782 | -c "! mbedtls_ssl_handshake returned" \ |
| 5783 | -s "X509 - Certificate verification failed" |
| 5784 | # We don't check that the client receives the alert because it might |
| 5785 | # detect that its write end of the connection is closed and abort |
| 5786 | # before reading the alert message. |
| 5787 | |
| 5788 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5790 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5791 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 5792 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5793 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5794 | key_file=data_files/server5.key" \ |
| 5795 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5796 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5797 | -S "skip write certificate request" \ |
| 5798 | -C "skip parse certificate request" \ |
| 5799 | -c "got a certificate request" \ |
| 5800 | -C "skip write certificate" \ |
| 5801 | -C "skip write certificate verify" \ |
| 5802 | -S "skip parse certificate verify" \ |
| 5803 | -s "x509_verify_cert() returned" \ |
| 5804 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5805 | -s "! mbedtls_ssl_handshake returned" \ |
| 5806 | -c "! mbedtls_ssl_handshake returned" \ |
| 5807 | -s "X509 - Certificate verification failed" |
| 5808 | |
| 5809 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5811 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5812 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 5813 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 5814 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5815 | key_file=data_files/server5.key" \ |
| 5816 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5817 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5818 | -S "skip write certificate request" \ |
| 5819 | -C "skip parse certificate request" \ |
| 5820 | -c "got a certificate request" \ |
| 5821 | -C "skip write certificate" \ |
| 5822 | -C "skip write certificate verify" \ |
| 5823 | -S "skip parse certificate verify" \ |
| 5824 | -s "x509_verify_cert() returned" \ |
| 5825 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5826 | -S "! mbedtls_ssl_handshake returned" \ |
| 5827 | -C "! mbedtls_ssl_handshake returned" \ |
| 5828 | -S "X509 - Certificate verification failed" |
| 5829 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5830 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5831 | requires_full_size_output_buffer |
| 5832 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5834 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5835 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5836 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5837 | key_file=data_files/dir-maxpath/09.key" \ |
| 5838 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5839 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5840 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5841 | -C "X509 - A fatal error occurred" |
| 5842 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5843 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5844 | requires_full_size_output_buffer |
| 5845 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5847 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5848 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5849 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5850 | key_file=data_files/dir-maxpath/10.key" \ |
| 5851 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5852 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5853 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5854 | -c "X509 - A fatal error occurred" |
| 5855 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5856 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5857 | requires_full_size_output_buffer |
| 5858 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5859 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5860 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5861 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5862 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5863 | key_file=data_files/dir-maxpath/10.key" \ |
| 5864 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 5865 | debug_level=3 auth_mode=optional" \ |
| 5866 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5867 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5868 | -c "X509 - A fatal error occurred" |
| 5869 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5870 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5871 | requires_full_size_output_buffer |
| 5872 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5874 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5875 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 5876 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5877 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5878 | key_file=data_files/dir-maxpath/10.key" \ |
| 5879 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5880 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5881 | -s "X509 - A fatal error occurred" |
| 5882 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5883 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5884 | requires_full_size_output_buffer |
| 5885 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5887 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5888 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 5889 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5890 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5891 | key_file=data_files/dir-maxpath/10.key" \ |
| 5892 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5893 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5894 | -s "X509 - A fatal error occurred" |
| 5895 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5896 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5897 | requires_full_size_output_buffer |
| 5898 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5899 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5900 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5901 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 5902 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5903 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5904 | key_file=data_files/dir-maxpath/09.key" \ |
| 5905 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5906 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5907 | -S "X509 - A fatal error occurred" |
| 5908 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5909 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5910 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5911 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5912 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5913 | "$P_SRV force_version=tls12 crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5914 | key_file=data_files/server5.key \ |
| 5915 | crt_file2=data_files/server5-sha1.crt \ |
| 5916 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5917 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5918 | 0 \ |
| 5919 | -c "signed using.*ECDSA with SHA256" \ |
| 5920 | -C "signed using.*ECDSA with SHA1" |
| 5921 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5922 | # tests for SNI |
| 5923 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5924 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5925 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5926 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5927 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5928 | 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] | 5929 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5930 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5931 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5932 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5933 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5934 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5935 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5936 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5937 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5938 | 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] | 5939 | 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] | 5940 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5941 | 0 \ |
| 5942 | -s "parse ServerName extension" \ |
| 5943 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5944 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5945 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5946 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5947 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5948 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5949 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5950 | 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] | 5951 | 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] | 5952 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5953 | 0 \ |
| 5954 | -s "parse ServerName extension" \ |
| 5955 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5956 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5957 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5958 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5959 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5960 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5961 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5962 | 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] | 5963 | 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] | 5964 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5965 | 1 \ |
| 5966 | -s "parse ServerName extension" \ |
| 5967 | -s "ssl_sni_wrapper() returned" \ |
| 5968 | -s "mbedtls_ssl_handshake returned" \ |
| 5969 | -c "mbedtls_ssl_handshake returned" \ |
| 5970 | -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] | 5971 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5972 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5973 | run_test "SNI: client auth no override: optional" \ |
| 5974 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5975 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5976 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5977 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5978 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5979 | -S "skip write certificate request" \ |
| 5980 | -C "skip parse certificate request" \ |
| 5981 | -c "got a certificate request" \ |
| 5982 | -C "skip write certificate" \ |
| 5983 | -C "skip write certificate verify" \ |
| 5984 | -S "skip parse certificate verify" |
| 5985 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5986 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5987 | run_test "SNI: client auth override: none -> optional" \ |
| 5988 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5989 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5990 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5991 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5992 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5993 | -S "skip write certificate request" \ |
| 5994 | -C "skip parse certificate request" \ |
| 5995 | -c "got a certificate request" \ |
| 5996 | -C "skip write certificate" \ |
| 5997 | -C "skip write certificate verify" \ |
| 5998 | -S "skip parse certificate verify" |
| 5999 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6000 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6001 | run_test "SNI: client auth override: optional -> none" \ |
| 6002 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6003 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6004 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6005 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6006 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6007 | -s "skip write certificate request" \ |
| 6008 | -C "skip parse certificate request" \ |
| 6009 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6010 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6011 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6012 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6013 | run_test "SNI: CA no override" \ |
| 6014 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6015 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6016 | ca_file=data_files/test-ca.crt \ |
| 6017 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6018 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6019 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6020 | 1 \ |
| 6021 | -S "skip write certificate request" \ |
| 6022 | -C "skip parse certificate request" \ |
| 6023 | -c "got a certificate request" \ |
| 6024 | -C "skip write certificate" \ |
| 6025 | -C "skip write certificate verify" \ |
| 6026 | -S "skip parse certificate verify" \ |
| 6027 | -s "x509_verify_cert() returned" \ |
| 6028 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6029 | -S "The certificate has been revoked (is on a CRL)" |
| 6030 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6031 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6032 | run_test "SNI: CA override" \ |
| 6033 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6034 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6035 | ca_file=data_files/test-ca.crt \ |
| 6036 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6037 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6038 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6039 | 0 \ |
| 6040 | -S "skip write certificate request" \ |
| 6041 | -C "skip parse certificate request" \ |
| 6042 | -c "got a certificate request" \ |
| 6043 | -C "skip write certificate" \ |
| 6044 | -C "skip write certificate verify" \ |
| 6045 | -S "skip parse certificate verify" \ |
| 6046 | -S "x509_verify_cert() returned" \ |
| 6047 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6048 | -S "The certificate has been revoked (is on a CRL)" |
| 6049 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6050 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6051 | run_test "SNI: CA override with CRL" \ |
| 6052 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6053 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6054 | ca_file=data_files/test-ca.crt \ |
| 6055 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6056 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6057 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6058 | 1 \ |
| 6059 | -S "skip write certificate request" \ |
| 6060 | -C "skip parse certificate request" \ |
| 6061 | -c "got a certificate request" \ |
| 6062 | -C "skip write certificate" \ |
| 6063 | -C "skip write certificate verify" \ |
| 6064 | -S "skip parse certificate verify" \ |
| 6065 | -s "x509_verify_cert() returned" \ |
| 6066 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6067 | -s "The certificate has been revoked (is on a CRL)" |
| 6068 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6069 | # Tests for SNI and DTLS |
| 6070 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6071 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6073 | run_test "SNI: DTLS, no SNI callback" \ |
| 6074 | "$P_SRV debug_level=3 dtls=1 \ |
| 6075 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6076 | "$P_CLI server_name=localhost dtls=1" \ |
| 6077 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6078 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6079 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6080 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6081 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6082 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6083 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6084 | "$P_SRV debug_level=3 dtls=1 \ |
| 6085 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6086 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6087 | "$P_CLI server_name=localhost dtls=1" \ |
| 6088 | 0 \ |
| 6089 | -s "parse ServerName extension" \ |
| 6090 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6091 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6092 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6093 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6095 | run_test "SNI: DTLS, matching cert 2" \ |
| 6096 | "$P_SRV debug_level=3 dtls=1 \ |
| 6097 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6098 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6099 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6100 | 0 \ |
| 6101 | -s "parse ServerName extension" \ |
| 6102 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6103 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6104 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6106 | run_test "SNI: DTLS, no matching cert" \ |
| 6107 | "$P_SRV debug_level=3 dtls=1 \ |
| 6108 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6109 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6110 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6111 | 1 \ |
| 6112 | -s "parse ServerName extension" \ |
| 6113 | -s "ssl_sni_wrapper() returned" \ |
| 6114 | -s "mbedtls_ssl_handshake returned" \ |
| 6115 | -c "mbedtls_ssl_handshake returned" \ |
| 6116 | -c "SSL - A fatal alert message was received from our peer" |
| 6117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6119 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6120 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6121 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6122 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6123 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6124 | 0 \ |
| 6125 | -S "skip write certificate request" \ |
| 6126 | -C "skip parse certificate request" \ |
| 6127 | -c "got a certificate request" \ |
| 6128 | -C "skip write certificate" \ |
| 6129 | -C "skip write certificate verify" \ |
| 6130 | -S "skip parse certificate verify" |
| 6131 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6133 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6134 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6135 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6136 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6137 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6138 | 0 \ |
| 6139 | -S "skip write certificate request" \ |
| 6140 | -C "skip parse certificate request" \ |
| 6141 | -c "got a certificate request" \ |
| 6142 | -C "skip write certificate" \ |
| 6143 | -C "skip write certificate verify" \ |
| 6144 | -S "skip parse certificate verify" |
| 6145 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6147 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6148 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6149 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6150 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6151 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6152 | 0 \ |
| 6153 | -s "skip write certificate request" \ |
| 6154 | -C "skip parse certificate request" \ |
| 6155 | -c "got no certificate request" \ |
| 6156 | -c "skip write certificate" \ |
| 6157 | -c "skip write certificate verify" \ |
| 6158 | -s "skip parse certificate verify" |
| 6159 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6161 | run_test "SNI: DTLS, CA no override" \ |
| 6162 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6163 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6164 | ca_file=data_files/test-ca.crt \ |
| 6165 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6166 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6167 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6168 | 1 \ |
| 6169 | -S "skip write certificate request" \ |
| 6170 | -C "skip parse certificate request" \ |
| 6171 | -c "got a certificate request" \ |
| 6172 | -C "skip write certificate" \ |
| 6173 | -C "skip write certificate verify" \ |
| 6174 | -S "skip parse certificate verify" \ |
| 6175 | -s "x509_verify_cert() returned" \ |
| 6176 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6177 | -S "The certificate has been revoked (is on a CRL)" |
| 6178 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6179 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6180 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6181 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6182 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6183 | ca_file=data_files/test-ca.crt \ |
| 6184 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6185 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6186 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6187 | 0 \ |
| 6188 | -S "skip write certificate request" \ |
| 6189 | -C "skip parse certificate request" \ |
| 6190 | -c "got a certificate request" \ |
| 6191 | -C "skip write certificate" \ |
| 6192 | -C "skip write certificate verify" \ |
| 6193 | -S "skip parse certificate verify" \ |
| 6194 | -S "x509_verify_cert() returned" \ |
| 6195 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6196 | -S "The certificate has been revoked (is on a CRL)" |
| 6197 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6199 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6200 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6201 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6202 | ca_file=data_files/test-ca.crt \ |
| 6203 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6204 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6205 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6206 | 1 \ |
| 6207 | -S "skip write certificate request" \ |
| 6208 | -C "skip parse certificate request" \ |
| 6209 | -c "got a certificate request" \ |
| 6210 | -C "skip write certificate" \ |
| 6211 | -C "skip write certificate verify" \ |
| 6212 | -S "skip parse certificate verify" \ |
| 6213 | -s "x509_verify_cert() returned" \ |
| 6214 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6215 | -s "The certificate has been revoked (is on a CRL)" |
| 6216 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6217 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6218 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6219 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6220 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6221 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6222 | "$P_CLI nbio=2 tickets=0" \ |
| 6223 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6224 | -S "mbedtls_ssl_handshake returned" \ |
| 6225 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6226 | -c "Read from server: .* bytes read" |
| 6227 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6228 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6229 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6230 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6231 | "$P_CLI nbio=2 tickets=0" \ |
| 6232 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6233 | -S "mbedtls_ssl_handshake returned" \ |
| 6234 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6235 | -c "Read from server: .* bytes read" |
| 6236 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6238 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6239 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6240 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6241 | "$P_CLI nbio=2 tickets=1" \ |
| 6242 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6243 | -S "mbedtls_ssl_handshake returned" \ |
| 6244 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6245 | -c "Read from server: .* bytes read" |
| 6246 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6248 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6249 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6250 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6251 | "$P_CLI nbio=2 tickets=1" \ |
| 6252 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6253 | -S "mbedtls_ssl_handshake returned" \ |
| 6254 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6255 | -c "Read from server: .* bytes read" |
| 6256 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6257 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6258 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6259 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6260 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6261 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6262 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6263 | -S "mbedtls_ssl_handshake returned" \ |
| 6264 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6265 | -c "Read from server: .* bytes read" |
| 6266 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6268 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6269 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6270 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6271 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 6272 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6273 | -S "mbedtls_ssl_handshake returned" \ |
| 6274 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6275 | -c "Read from server: .* bytes read" |
| 6276 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6278 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6279 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6280 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6281 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 6282 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6283 | -S "mbedtls_ssl_handshake returned" \ |
| 6284 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6285 | -c "Read from server: .* bytes read" |
| 6286 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6287 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6288 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6289 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6290 | run_test "Event-driven I/O: basic handshake" \ |
| 6291 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6292 | "$P_CLI event=1 tickets=0" \ |
| 6293 | 0 \ |
| 6294 | -S "mbedtls_ssl_handshake returned" \ |
| 6295 | -C "mbedtls_ssl_handshake returned" \ |
| 6296 | -c "Read from server: .* bytes read" |
| 6297 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6298 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6299 | run_test "Event-driven I/O: client auth" \ |
| 6300 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6301 | "$P_CLI event=1 tickets=0" \ |
| 6302 | 0 \ |
| 6303 | -S "mbedtls_ssl_handshake returned" \ |
| 6304 | -C "mbedtls_ssl_handshake returned" \ |
| 6305 | -c "Read from server: .* bytes read" |
| 6306 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6307 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6308 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6309 | run_test "Event-driven I/O: ticket" \ |
| 6310 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6311 | "$P_CLI event=1 tickets=1" \ |
| 6312 | 0 \ |
| 6313 | -S "mbedtls_ssl_handshake returned" \ |
| 6314 | -C "mbedtls_ssl_handshake returned" \ |
| 6315 | -c "Read from server: .* bytes read" |
| 6316 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6317 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6318 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6319 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6320 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6321 | "$P_CLI event=1 tickets=1" \ |
| 6322 | 0 \ |
| 6323 | -S "mbedtls_ssl_handshake returned" \ |
| 6324 | -C "mbedtls_ssl_handshake returned" \ |
| 6325 | -c "Read from server: .* bytes read" |
| 6326 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6327 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6328 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6329 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 6330 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6331 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6332 | 0 \ |
| 6333 | -S "mbedtls_ssl_handshake returned" \ |
| 6334 | -C "mbedtls_ssl_handshake returned" \ |
| 6335 | -c "Read from server: .* bytes read" |
| 6336 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6338 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6339 | run_test "Event-driven I/O: ticket + resume" \ |
| 6340 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6341 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 6342 | 0 \ |
| 6343 | -S "mbedtls_ssl_handshake returned" \ |
| 6344 | -C "mbedtls_ssl_handshake returned" \ |
| 6345 | -c "Read from server: .* bytes read" |
| 6346 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6348 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6349 | run_test "Event-driven I/O: session-id resume" \ |
| 6350 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6351 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 6352 | 0 \ |
| 6353 | -S "mbedtls_ssl_handshake returned" \ |
| 6354 | -C "mbedtls_ssl_handshake returned" \ |
| 6355 | -c "Read from server: .* bytes read" |
| 6356 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6358 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6359 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6360 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6361 | 0 \ |
| 6362 | -c "Read from server: .* bytes read" |
| 6363 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6365 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6366 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6367 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6368 | 0 \ |
| 6369 | -c "Read from server: .* bytes read" |
| 6370 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6371 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6372 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6373 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6374 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6375 | 0 \ |
| 6376 | -c "Read from server: .* bytes read" |
| 6377 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6379 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6380 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6381 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6382 | 0 \ |
| 6383 | -c "Read from server: .* bytes read" |
| 6384 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6386 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6387 | "$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] | 6388 | "$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] | 6389 | 0 \ |
| 6390 | -c "Read from server: .* bytes read" |
| 6391 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6393 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6394 | "$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] | 6395 | "$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] | 6396 | 0 \ |
| 6397 | -c "Read from server: .* bytes read" |
| 6398 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6400 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6401 | "$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] | 6402 | "$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] | 6403 | 0 \ |
| 6404 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6405 | |
| 6406 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6407 | # During session resumption, the client will send its ApplicationData record |
| 6408 | # within the same datagram as the Finished messages. In this situation, the |
| 6409 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6410 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6412 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6413 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6414 | "$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] | 6415 | "$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] | 6416 | 0 \ |
| 6417 | -c "Read from server: .* bytes read" |
| 6418 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6419 | # Tests for version negotiation |
| 6420 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6422 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6423 | "$P_SRV" \ |
| 6424 | "$P_CLI" \ |
| 6425 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6426 | -S "mbedtls_ssl_handshake returned" \ |
| 6427 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6428 | -s "Protocol is TLSv1.2" \ |
| 6429 | -c "Protocol is TLSv1.2" |
| 6430 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6432 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6433 | "$P_SRV" \ |
| 6434 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6435 | 1 \ |
| 6436 | -s "Handshake protocol not within min/max boundaries" \ |
| 6437 | -c "Error in protocol version" \ |
| 6438 | -S "Protocol is TLSv1.0" \ |
| 6439 | -C "Handshake was completed" |
| 6440 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6442 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6443 | "$P_SRV" \ |
| 6444 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6445 | 1 \ |
| 6446 | -s "Handshake protocol not within min/max boundaries" \ |
| 6447 | -c "Error in protocol version" \ |
| 6448 | -S "Protocol is TLSv1.1" \ |
| 6449 | -C "Handshake was completed" |
| 6450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6452 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6453 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6454 | "$P_CLI" \ |
| 6455 | 1 \ |
| 6456 | -s "Error in protocol version" \ |
| 6457 | -c "Handshake protocol not within min/max boundaries" \ |
| 6458 | -S "Version: TLS1.0" \ |
| 6459 | -C "Protocol is TLSv1.0" |
| 6460 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6462 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6463 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6464 | "$P_CLI" \ |
| 6465 | 1 \ |
| 6466 | -s "Error in protocol version" \ |
| 6467 | -c "Handshake protocol not within min/max boundaries" \ |
| 6468 | -S "Version: TLS1.1" \ |
| 6469 | -C "Protocol is TLSv1.1" |
| 6470 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6471 | # Tests for ALPN extension |
| 6472 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6473 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6474 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6475 | "$P_SRV debug_level=3" \ |
| 6476 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6477 | 0 \ |
| 6478 | -C "client hello, adding alpn extension" \ |
| 6479 | -S "found alpn extension" \ |
| 6480 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6481 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6482 | -C "found alpn extension " \ |
| 6483 | -C "Application Layer Protocol is" \ |
| 6484 | -S "Application Layer Protocol is" |
| 6485 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6486 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6487 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6488 | "$P_SRV debug_level=3" \ |
| 6489 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6490 | 0 \ |
| 6491 | -c "client hello, adding alpn extension" \ |
| 6492 | -s "found alpn extension" \ |
| 6493 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6494 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6495 | -C "found alpn extension " \ |
| 6496 | -c "Application Layer Protocol is (none)" \ |
| 6497 | -S "Application Layer Protocol is" |
| 6498 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6499 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6500 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6501 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6502 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6503 | 0 \ |
| 6504 | -C "client hello, adding alpn extension" \ |
| 6505 | -S "found alpn extension" \ |
| 6506 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6507 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6508 | -C "found alpn extension " \ |
| 6509 | -C "Application Layer Protocol is" \ |
| 6510 | -s "Application Layer Protocol is (none)" |
| 6511 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6512 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6513 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6514 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6515 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6516 | 0 \ |
| 6517 | -c "client hello, adding alpn extension" \ |
| 6518 | -s "found alpn extension" \ |
| 6519 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6520 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6521 | -c "found alpn extension" \ |
| 6522 | -c "Application Layer Protocol is abc" \ |
| 6523 | -s "Application Layer Protocol is abc" |
| 6524 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6525 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6526 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6527 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6528 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6529 | 0 \ |
| 6530 | -c "client hello, adding alpn extension" \ |
| 6531 | -s "found alpn extension" \ |
| 6532 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6533 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6534 | -c "found alpn extension" \ |
| 6535 | -c "Application Layer Protocol is abc" \ |
| 6536 | -s "Application Layer Protocol is abc" |
| 6537 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6538 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6539 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6540 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6541 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6542 | 0 \ |
| 6543 | -c "client hello, adding alpn extension" \ |
| 6544 | -s "found alpn extension" \ |
| 6545 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6546 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6547 | -c "found alpn extension" \ |
| 6548 | -c "Application Layer Protocol is 1234" \ |
| 6549 | -s "Application Layer Protocol is 1234" |
| 6550 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6551 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6552 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6553 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6554 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6555 | 1 \ |
| 6556 | -c "client hello, adding alpn extension" \ |
| 6557 | -s "found alpn extension" \ |
| 6558 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6559 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6560 | -C "found alpn extension" \ |
| 6561 | -C "Application Layer Protocol is 1234" \ |
| 6562 | -S "Application Layer Protocol is 1234" |
| 6563 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6564 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6565 | # Tests for keyUsage in leaf certificates, part 1: |
| 6566 | # server-side certificate/suite selection |
| 6567 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6569 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6570 | "$P_SRV key_file=data_files/server2.key \ |
| 6571 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6572 | "$P_CLI" \ |
| 6573 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6574 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6575 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6577 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6578 | "$P_SRV key_file=data_files/server2.key \ |
| 6579 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6580 | "$P_CLI" \ |
| 6581 | 0 \ |
| 6582 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6585 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6586 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6587 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6588 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6589 | 1 \ |
| 6590 | -C "Ciphersuite is " |
| 6591 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6593 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6594 | "$P_SRV key_file=data_files/server5.key \ |
| 6595 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6596 | "$P_CLI" \ |
| 6597 | 0 \ |
| 6598 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6599 | |
| 6600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6602 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6603 | "$P_SRV key_file=data_files/server5.key \ |
| 6604 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6605 | "$P_CLI" \ |
| 6606 | 0 \ |
| 6607 | -c "Ciphersuite is TLS-ECDH-" |
| 6608 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6610 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6611 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6612 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6613 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6614 | 1 \ |
| 6615 | -C "Ciphersuite is " |
| 6616 | |
| 6617 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6618 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6619 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6621 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6622 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6623 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6624 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6625 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6626 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6627 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6628 | -C "Processing of the Certificate handshake message failed" \ |
| 6629 | -c "Ciphersuite is TLS-" |
| 6630 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6631 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6632 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6633 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6634 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6635 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6636 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6637 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6638 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6639 | -C "Processing of the Certificate handshake message failed" \ |
| 6640 | -c "Ciphersuite is TLS-" |
| 6641 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6642 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6643 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6644 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6645 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6646 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6647 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6648 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6649 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6650 | -C "Processing of the Certificate handshake message failed" \ |
| 6651 | -c "Ciphersuite is TLS-" |
| 6652 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6653 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6654 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6655 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6656 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6657 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6658 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6659 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6660 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6661 | -c "Processing of the Certificate handshake message failed" \ |
| 6662 | -C "Ciphersuite is TLS-" |
| 6663 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6665 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6666 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6667 | -cert data_files/server2.ku-ke.crt" \ |
| 6668 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6669 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6670 | 0 \ |
| 6671 | -c "bad certificate (usage extensions)" \ |
| 6672 | -C "Processing of the Certificate handshake message failed" \ |
| 6673 | -c "Ciphersuite is TLS-" \ |
| 6674 | -c "! Usage does not match the keyUsage extension" |
| 6675 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6677 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6678 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6679 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6680 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6681 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6682 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6683 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6684 | -C "Processing of the Certificate handshake message failed" \ |
| 6685 | -c "Ciphersuite is TLS-" |
| 6686 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6688 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6689 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6690 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6691 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6692 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6693 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6694 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6695 | -c "Processing of the Certificate handshake message failed" \ |
| 6696 | -C "Ciphersuite is TLS-" |
| 6697 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6698 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6699 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6700 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6701 | -cert data_files/server2.ku-ds.crt" \ |
| 6702 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6703 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6704 | 0 \ |
| 6705 | -c "bad certificate (usage extensions)" \ |
| 6706 | -C "Processing of the Certificate handshake message failed" \ |
| 6707 | -c "Ciphersuite is TLS-" \ |
| 6708 | -c "! Usage does not match the keyUsage extension" |
| 6709 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6710 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6711 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6712 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6713 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6714 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6715 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6716 | "$P_CLI debug_level=3" \ |
| 6717 | 0 \ |
| 6718 | -C "bad certificate (usage extensions)" \ |
| 6719 | -C "Processing of the Certificate handshake message failed" \ |
| 6720 | -c "Ciphersuite is" |
| 6721 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6722 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6723 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6724 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6725 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6726 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6727 | -cert data_files/server2.ku-ke.crt" \ |
| 6728 | "$P_CLI debug_level=1" \ |
| 6729 | 1 \ |
| 6730 | -c "bad certificate (usage extensions)" \ |
| 6731 | -c "Processing of the Certificate handshake message failed" \ |
| 6732 | -C "Ciphersuite is" |
| 6733 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6734 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6735 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6736 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6737 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6738 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6739 | -cert data_files/server2.ku-ka.crt" \ |
| 6740 | "$P_CLI debug_level=1" \ |
| 6741 | 1 \ |
| 6742 | -c "bad certificate (usage extensions)" \ |
| 6743 | -c "Processing of the Certificate handshake message failed" \ |
| 6744 | -C "Ciphersuite is" |
| 6745 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6746 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6747 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6748 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6749 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6750 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6751 | -cert data_files/server5.ku-ds.crt" \ |
| 6752 | "$P_CLI debug_level=3" \ |
| 6753 | 0 \ |
| 6754 | -C "bad certificate (usage extensions)" \ |
| 6755 | -C "Processing of the Certificate handshake message failed" \ |
| 6756 | -c "Ciphersuite is" |
| 6757 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6758 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6759 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6760 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6761 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6762 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6763 | -cert data_files/server5.ku-ke.crt" \ |
| 6764 | "$P_CLI debug_level=1" \ |
| 6765 | 1 \ |
| 6766 | -c "bad certificate (usage extensions)" \ |
| 6767 | -c "Processing of the Certificate handshake message failed" \ |
| 6768 | -C "Ciphersuite is" |
| 6769 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6770 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6771 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6772 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6773 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6774 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6775 | -cert data_files/server5.ku-ka.crt" \ |
| 6776 | "$P_CLI debug_level=1" \ |
| 6777 | 1 \ |
| 6778 | -c "bad certificate (usage extensions)" \ |
| 6779 | -c "Processing of the Certificate handshake message failed" \ |
| 6780 | -C "Ciphersuite is" |
| 6781 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6782 | # Tests for keyUsage in leaf certificates, part 3: |
| 6783 | # server-side checking of client cert |
| 6784 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6786 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6787 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6788 | "$O_CLI -key data_files/server2.key \ |
| 6789 | -cert data_files/server2.ku-ds.crt" \ |
| 6790 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6791 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6792 | -S "bad certificate (usage extensions)" \ |
| 6793 | -S "Processing of the Certificate handshake message failed" |
| 6794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6796 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6797 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6798 | "$O_CLI -key data_files/server2.key \ |
| 6799 | -cert data_files/server2.ku-ke.crt" \ |
| 6800 | 0 \ |
| 6801 | -s "bad certificate (usage extensions)" \ |
| 6802 | -S "Processing of the Certificate handshake message failed" |
| 6803 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6804 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6805 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6806 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6807 | "$O_CLI -key data_files/server2.key \ |
| 6808 | -cert data_files/server2.ku-ke.crt" \ |
| 6809 | 1 \ |
| 6810 | -s "bad certificate (usage extensions)" \ |
| 6811 | -s "Processing of the Certificate handshake message failed" |
| 6812 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6814 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6815 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6816 | "$O_CLI -key data_files/server5.key \ |
| 6817 | -cert data_files/server5.ku-ds.crt" \ |
| 6818 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6819 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6820 | -S "bad certificate (usage extensions)" \ |
| 6821 | -S "Processing of the Certificate handshake message failed" |
| 6822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6824 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6825 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6826 | "$O_CLI -key data_files/server5.key \ |
| 6827 | -cert data_files/server5.ku-ka.crt" \ |
| 6828 | 0 \ |
| 6829 | -s "bad certificate (usage extensions)" \ |
| 6830 | -S "Processing of the Certificate handshake message failed" |
| 6831 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6832 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6833 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6834 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6835 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6836 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6837 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6838 | -cert data_files/server2.ku-ds.crt" \ |
| 6839 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6840 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6841 | -S "bad certificate (usage extensions)" \ |
| 6842 | -S "Processing of the Certificate handshake message failed" |
| 6843 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6844 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6845 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6846 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6847 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6848 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6849 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6850 | -cert data_files/server2.ku-ke.crt" \ |
| 6851 | 0 \ |
| 6852 | -s "bad certificate (usage extensions)" \ |
| 6853 | -S "Processing of the Certificate handshake message failed" |
| 6854 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6855 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6856 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6857 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6858 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6859 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6860 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6861 | -cert data_files/server5.ku-ds.crt" \ |
| 6862 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6863 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6864 | -S "bad certificate (usage extensions)" \ |
| 6865 | -S "Processing of the Certificate handshake message failed" |
| 6866 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6867 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6868 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6869 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6870 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6871 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6872 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6873 | -cert data_files/server5.ku-ka.crt" \ |
| 6874 | 0 \ |
| 6875 | -s "bad certificate (usage extensions)" \ |
| 6876 | -S "Processing of the Certificate handshake message failed" |
| 6877 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6878 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6879 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6881 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6882 | "$P_SRV key_file=data_files/server5.key \ |
| 6883 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6884 | "$P_CLI" \ |
| 6885 | 0 |
| 6886 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6888 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6889 | "$P_SRV key_file=data_files/server5.key \ |
| 6890 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6891 | "$P_CLI" \ |
| 6892 | 0 |
| 6893 | |
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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6895 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6896 | "$P_SRV key_file=data_files/server5.key \ |
| 6897 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6898 | "$P_CLI" \ |
| 6899 | 0 |
| 6900 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6902 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6903 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6904 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 6905 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6906 | 1 |
| 6907 | |
| 6908 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 6909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6911 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6912 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6913 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6914 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6915 | 0 \ |
| 6916 | -C "bad certificate (usage extensions)" \ |
| 6917 | -C "Processing of the Certificate handshake message failed" \ |
| 6918 | -c "Ciphersuite is TLS-" |
| 6919 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6920 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6921 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6922 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6923 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6924 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6925 | 0 \ |
| 6926 | -C "bad certificate (usage extensions)" \ |
| 6927 | -C "Processing of the Certificate handshake message failed" \ |
| 6928 | -c "Ciphersuite is TLS-" |
| 6929 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6930 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6931 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6932 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6933 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6934 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6935 | 0 \ |
| 6936 | -C "bad certificate (usage extensions)" \ |
| 6937 | -C "Processing of the Certificate handshake message failed" \ |
| 6938 | -c "Ciphersuite is TLS-" |
| 6939 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6940 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6941 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6942 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6943 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6944 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6945 | 1 \ |
| 6946 | -c "bad certificate (usage extensions)" \ |
| 6947 | -c "Processing of the Certificate handshake message failed" \ |
| 6948 | -C "Ciphersuite is TLS-" |
| 6949 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6950 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6951 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6952 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6953 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 6954 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6955 | -cert data_files/server5.eku-srv.crt" \ |
| 6956 | "$P_CLI debug_level=1" \ |
| 6957 | 0 \ |
| 6958 | -C "bad certificate (usage extensions)" \ |
| 6959 | -C "Processing of the Certificate handshake message failed" \ |
| 6960 | -c "Ciphersuite is" |
| 6961 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6962 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6963 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6964 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6965 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 6966 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6967 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 6968 | "$P_CLI debug_level=1" \ |
| 6969 | 0 \ |
| 6970 | -C "bad certificate (usage extensions)" \ |
| 6971 | -C "Processing of the Certificate handshake message failed" \ |
| 6972 | -c "Ciphersuite is" |
| 6973 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6974 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6975 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6976 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6977 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 6978 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6979 | -cert data_files/server5.eku-cs_any.crt" \ |
| 6980 | "$P_CLI debug_level=1" \ |
| 6981 | 0 \ |
| 6982 | -C "bad certificate (usage extensions)" \ |
| 6983 | -C "Processing of the Certificate handshake message failed" \ |
| 6984 | -c "Ciphersuite is" |
| 6985 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6986 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6987 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6988 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6989 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 6990 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6991 | -cert data_files/server5.eku-cs.crt" \ |
| 6992 | "$P_CLI debug_level=1" \ |
| 6993 | 1 \ |
| 6994 | -c "bad certificate (usage extensions)" \ |
| 6995 | -c "Processing of the Certificate handshake message failed" \ |
| 6996 | -C "Ciphersuite is" |
| 6997 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6998 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 6999 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7000 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7001 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7002 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7003 | "$O_CLI -key data_files/server5.key \ |
| 7004 | -cert data_files/server5.eku-cli.crt" \ |
| 7005 | 0 \ |
| 7006 | -S "bad certificate (usage extensions)" \ |
| 7007 | -S "Processing of the Certificate handshake message failed" |
| 7008 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7010 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7011 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7012 | "$O_CLI -key data_files/server5.key \ |
| 7013 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7014 | 0 \ |
| 7015 | -S "bad certificate (usage extensions)" \ |
| 7016 | -S "Processing of the Certificate handshake message failed" |
| 7017 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7019 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7020 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7021 | "$O_CLI -key data_files/server5.key \ |
| 7022 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7023 | 0 \ |
| 7024 | -S "bad certificate (usage extensions)" \ |
| 7025 | -S "Processing of the Certificate handshake message failed" |
| 7026 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7028 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7029 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7030 | "$O_CLI -key data_files/server5.key \ |
| 7031 | -cert data_files/server5.eku-cs.crt" \ |
| 7032 | 0 \ |
| 7033 | -s "bad certificate (usage extensions)" \ |
| 7034 | -S "Processing of the Certificate handshake message failed" |
| 7035 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7037 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7038 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7039 | "$O_CLI -key data_files/server5.key \ |
| 7040 | -cert data_files/server5.eku-cs.crt" \ |
| 7041 | 1 \ |
| 7042 | -s "bad certificate (usage extensions)" \ |
| 7043 | -s "Processing of the Certificate handshake message failed" |
| 7044 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7045 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7046 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7047 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7048 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7049 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7050 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7051 | -cert data_files/server5.eku-cli.crt" \ |
| 7052 | 0 \ |
| 7053 | -S "bad certificate (usage extensions)" \ |
| 7054 | -S "Processing of the Certificate handshake message failed" |
| 7055 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7056 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7057 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7058 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7059 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7060 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7061 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7062 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7063 | 0 \ |
| 7064 | -S "bad certificate (usage extensions)" \ |
| 7065 | -S "Processing of the Certificate handshake message failed" |
| 7066 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7067 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7068 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7069 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7070 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7071 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7072 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7073 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7074 | 0 \ |
| 7075 | -S "bad certificate (usage extensions)" \ |
| 7076 | -S "Processing of the Certificate handshake message failed" |
| 7077 | |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7078 | requires_openssl_tls1_3 |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7079 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7080 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7081 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7082 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7083 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7084 | -cert data_files/server5.eku-cs.crt" \ |
| 7085 | 0 \ |
| 7086 | -s "bad certificate (usage extensions)" \ |
| 7087 | -S "Processing of the Certificate handshake message failed" |
| 7088 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7089 | # Tests for DHM parameters loading |
| 7090 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7091 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7092 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7093 | "$P_SRV" \ |
| 7094 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7095 | debug_level=3" \ |
| 7096 | 0 \ |
| 7097 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7098 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7101 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7102 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7103 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7104 | debug_level=3" \ |
| 7105 | 0 \ |
| 7106 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7107 | -c "value of 'DHM: G ' (2 bits)" |
| 7108 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7109 | # Tests for DHM client-side size checking |
| 7110 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7111 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7112 | run_test "DHM size: server default, client default, OK" \ |
| 7113 | "$P_SRV" \ |
| 7114 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7115 | debug_level=1" \ |
| 7116 | 0 \ |
| 7117 | -C "DHM prime too short:" |
| 7118 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7120 | run_test "DHM size: server default, client 2048, OK" \ |
| 7121 | "$P_SRV" \ |
| 7122 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7123 | debug_level=1 dhmlen=2048" \ |
| 7124 | 0 \ |
| 7125 | -C "DHM prime too short:" |
| 7126 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7128 | run_test "DHM size: server 1024, client default, OK" \ |
| 7129 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7130 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7131 | debug_level=1" \ |
| 7132 | 0 \ |
| 7133 | -C "DHM prime too short:" |
| 7134 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7136 | run_test "DHM size: server 999, client 999, OK" \ |
| 7137 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7138 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7139 | debug_level=1 dhmlen=999" \ |
| 7140 | 0 \ |
| 7141 | -C "DHM prime too short:" |
| 7142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7144 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7145 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7146 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7147 | debug_level=1 dhmlen=1000" \ |
| 7148 | 0 \ |
| 7149 | -C "DHM prime too short:" |
| 7150 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7151 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7152 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7153 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7154 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7155 | debug_level=1" \ |
| 7156 | 1 \ |
| 7157 | -c "DHM prime too short:" |
| 7158 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7160 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7161 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7162 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7163 | debug_level=1 dhmlen=1001" \ |
| 7164 | 1 \ |
| 7165 | -c "DHM prime too short:" |
| 7166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7168 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7169 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7170 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7171 | debug_level=1 dhmlen=1000" \ |
| 7172 | 1 \ |
| 7173 | -c "DHM prime too short:" |
| 7174 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7175 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7176 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7177 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7178 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7179 | debug_level=1 dhmlen=999" \ |
| 7180 | 1 \ |
| 7181 | -c "DHM prime too short:" |
| 7182 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7184 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7185 | "$P_SRV" \ |
| 7186 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7187 | debug_level=1 dhmlen=2049" \ |
| 7188 | 1 \ |
| 7189 | -c "DHM prime too short:" |
| 7190 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7191 | # Tests for PSK callback |
| 7192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7194 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7195 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7196 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7197 | psk_identity=foo psk=abc123" \ |
| 7198 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7199 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7200 | -S "SSL - Unknown identity received" \ |
| 7201 | -S "SSL - Verification of the message MAC failed" |
| 7202 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7203 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7205 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7206 | "$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] | 7207 | "$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] | 7208 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7209 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7210 | -C "session hash for extended master secret"\ |
| 7211 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7212 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7213 | -S "SSL - Unknown identity received" \ |
| 7214 | -S "SSL - Verification of the message MAC failed" |
| 7215 | |
| 7216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7218 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7219 | "$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] | 7220 | "$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] | 7221 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7222 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7223 | -C "session hash for extended master secret"\ |
| 7224 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7225 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7226 | -S "SSL - Unknown identity received" \ |
| 7227 | -S "SSL - Verification of the message MAC failed" |
| 7228 | |
| 7229 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7231 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7232 | "$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] | 7233 | "$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] | 7234 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7235 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7236 | -c "session hash for extended master secret"\ |
| 7237 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7238 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7239 | -S "SSL - Unknown identity received" \ |
| 7240 | -S "SSL - Verification of the message MAC failed" |
| 7241 | |
| 7242 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7244 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7245 | "$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] | 7246 | "$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] | 7247 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7248 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7249 | -c "session hash for extended master secret"\ |
| 7250 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7251 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7252 | -S "SSL - Unknown identity received" \ |
| 7253 | -S "SSL - Verification of the message MAC failed" |
| 7254 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7255 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7257 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7258 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7259 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7260 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7261 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7262 | -C "session hash for extended master secret"\ |
| 7263 | -S "session hash for extended master secret"\ |
| 7264 | -S "SSL - The handshake negotiation failed" \ |
| 7265 | -S "SSL - Unknown identity received" \ |
| 7266 | -S "SSL - Verification of the message MAC failed" |
| 7267 | |
| 7268 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7269 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7270 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7271 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7272 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7273 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7274 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7275 | -C "session hash for extended master secret"\ |
| 7276 | -S "session hash for extended master secret"\ |
| 7277 | -S "SSL - The handshake negotiation failed" \ |
| 7278 | -S "SSL - Unknown identity received" \ |
| 7279 | -S "SSL - Verification of the message MAC failed" |
| 7280 | |
| 7281 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7283 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7284 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7285 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7286 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7287 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7288 | -c "session hash for extended master secret"\ |
| 7289 | -s "session hash for extended master secret"\ |
| 7290 | -S "SSL - The handshake negotiation failed" \ |
| 7291 | -S "SSL - Unknown identity received" \ |
| 7292 | -S "SSL - Verification of the message MAC failed" |
| 7293 | |
| 7294 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7295 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7296 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7297 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7298 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7299 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7300 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7301 | -c "session hash for extended master secret"\ |
| 7302 | -s "session hash for extended master secret"\ |
| 7303 | -S "SSL - The handshake negotiation failed" \ |
| 7304 | -S "SSL - Unknown identity received" \ |
| 7305 | -S "SSL - Verification of the message MAC failed" |
| 7306 | |
| 7307 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7309 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7310 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7311 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7312 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7313 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7314 | -C "session hash for extended master secret"\ |
| 7315 | -S "session hash for extended master secret"\ |
| 7316 | -S "SSL - The handshake negotiation failed" \ |
| 7317 | -S "SSL - Unknown identity received" \ |
| 7318 | -S "SSL - Verification of the message MAC failed" |
| 7319 | |
| 7320 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7322 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7323 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7324 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7325 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7326 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7327 | -C "session hash for extended master secret"\ |
| 7328 | -S "session hash for extended master secret"\ |
| 7329 | -S "SSL - The handshake negotiation failed" \ |
| 7330 | -S "SSL - Unknown identity received" \ |
| 7331 | -S "SSL - Verification of the message MAC failed" |
| 7332 | |
| 7333 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7335 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7336 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7337 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7338 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7339 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7340 | -c "session hash for extended master secret"\ |
| 7341 | -s "session hash for extended master secret"\ |
| 7342 | -S "SSL - The handshake negotiation failed" \ |
| 7343 | -S "SSL - Unknown identity received" \ |
| 7344 | -S "SSL - Verification of the message MAC failed" |
| 7345 | |
| 7346 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7347 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7348 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7349 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7350 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7351 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7352 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7353 | -c "session hash for extended master secret"\ |
| 7354 | -s "session hash for extended master secret"\ |
| 7355 | -S "SSL - The handshake negotiation failed" \ |
| 7356 | -S "SSL - Unknown identity received" \ |
| 7357 | -S "SSL - Verification of the message MAC failed" |
| 7358 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7359 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7360 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7361 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7362 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7363 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7364 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7365 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7366 | -C "session hash for extended master secret"\ |
| 7367 | -S "session hash for extended master secret"\ |
| 7368 | -S "SSL - The handshake negotiation failed" \ |
| 7369 | -S "SSL - Unknown identity received" \ |
| 7370 | -S "SSL - Verification of the message MAC failed" |
| 7371 | |
| 7372 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7374 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7375 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7376 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7377 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7378 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7379 | -C "session hash for extended master secret"\ |
| 7380 | -S "session hash for extended master secret"\ |
| 7381 | -S "SSL - The handshake negotiation failed" \ |
| 7382 | -S "SSL - Unknown identity received" \ |
| 7383 | -S "SSL - Verification of the message MAC failed" |
| 7384 | |
| 7385 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7387 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7388 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7389 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7390 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7391 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7392 | -c "session hash for extended master secret"\ |
| 7393 | -s "session hash for extended master secret"\ |
| 7394 | -S "SSL - The handshake negotiation failed" \ |
| 7395 | -S "SSL - Unknown identity received" \ |
| 7396 | -S "SSL - Verification of the message MAC failed" |
| 7397 | |
| 7398 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7399 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7400 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7401 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7402 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7403 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7404 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7405 | -c "session hash for extended master secret"\ |
| 7406 | -s "session hash for extended master secret"\ |
| 7407 | -S "SSL - The handshake negotiation failed" \ |
| 7408 | -S "SSL - Unknown identity received" \ |
| 7409 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7410 | |
| 7411 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7413 | 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] | 7414 | "$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" \ |
| 7415 | "$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] | 7416 | psk_identity=foo psk=abc123" \ |
| 7417 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7418 | -C "session hash for extended master secret"\ |
| 7419 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7420 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7421 | -S "SSL - Unknown identity received" \ |
| 7422 | -S "SSL - Verification of the message MAC failed" |
| 7423 | |
| 7424 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7426 | 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] | 7427 | "$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" \ |
| 7428 | "$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] | 7429 | psk_identity=foo psk=abc123" \ |
| 7430 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7431 | -C "session hash for extended master secret"\ |
| 7432 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7433 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7434 | -S "SSL - Unknown identity received" \ |
| 7435 | -S "SSL - Verification of the message MAC failed" |
| 7436 | |
| 7437 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7439 | 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] | 7440 | "$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] | 7441 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7442 | "$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] | 7443 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7444 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7445 | -c "session hash for extended master secret"\ |
| 7446 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7447 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7448 | -S "SSL - Unknown identity received" \ |
| 7449 | -S "SSL - Verification of the message MAC failed" |
| 7450 | |
| 7451 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7453 | 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] | 7454 | "$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] | 7455 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7456 | "$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] | 7457 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7458 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7459 | -c "session hash for extended master secret"\ |
| 7460 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7461 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7462 | -S "SSL - Unknown identity received" \ |
| 7463 | -S "SSL - Verification of the message MAC failed" |
| 7464 | |
| 7465 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7467 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7468 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7469 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7470 | psk_identity=foo psk=abc123" \ |
| 7471 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7472 | -C "session hash for extended master secret"\ |
| 7473 | -S "session hash for extended master secret"\ |
| 7474 | -S "SSL - The handshake negotiation failed" \ |
| 7475 | -S "SSL - Unknown identity received" \ |
| 7476 | -S "SSL - Verification of the message MAC failed" |
| 7477 | |
| 7478 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7480 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7481 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7482 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7483 | psk_identity=foo psk=abc123" \ |
| 7484 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7485 | -C "session hash for extended master secret"\ |
| 7486 | -S "session hash for extended master secret"\ |
| 7487 | -S "SSL - The handshake negotiation failed" \ |
| 7488 | -S "SSL - Unknown identity received" \ |
| 7489 | -S "SSL - Verification of the message MAC failed" |
| 7490 | |
| 7491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7493 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7494 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7495 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7496 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7497 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7498 | 0 \ |
| 7499 | -c "session hash for extended master secret"\ |
| 7500 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7501 | -S "SSL - The handshake negotiation failed" \ |
| 7502 | -S "SSL - Unknown identity received" \ |
| 7503 | -S "SSL - Verification of the message MAC failed" |
| 7504 | |
| 7505 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7507 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7508 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7509 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7510 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7511 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7512 | 0 \ |
| 7513 | -c "session hash for extended master secret"\ |
| 7514 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7515 | -S "SSL - The handshake negotiation failed" \ |
| 7516 | -S "SSL - Unknown identity received" \ |
| 7517 | -S "SSL - Verification of the message MAC failed" |
| 7518 | |
| 7519 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7521 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7522 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7523 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7524 | psk_identity=foo psk=abc123" \ |
| 7525 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7526 | -C "session hash for extended master secret"\ |
| 7527 | -S "session hash for extended master secret"\ |
| 7528 | -S "SSL - The handshake negotiation failed" \ |
| 7529 | -S "SSL - Unknown identity received" \ |
| 7530 | -S "SSL - Verification of the message MAC failed" |
| 7531 | |
| 7532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7534 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7535 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7536 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7537 | psk_identity=foo psk=abc123" \ |
| 7538 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7539 | -C "session hash for extended master secret"\ |
| 7540 | -S "session hash for extended master secret"\ |
| 7541 | -S "SSL - The handshake negotiation failed" \ |
| 7542 | -S "SSL - Unknown identity received" \ |
| 7543 | -S "SSL - Verification of the message MAC failed" |
| 7544 | |
| 7545 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7547 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7548 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7549 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7550 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7551 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7552 | 0 \ |
| 7553 | -c "session hash for extended master secret"\ |
| 7554 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7555 | -S "SSL - The handshake negotiation failed" \ |
| 7556 | -S "SSL - Unknown identity received" \ |
| 7557 | -S "SSL - Verification of the message MAC failed" |
| 7558 | |
| 7559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7561 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7562 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7563 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7564 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7565 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7566 | 0 \ |
| 7567 | -c "session hash for extended master secret"\ |
| 7568 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7569 | -S "SSL - The handshake negotiation failed" \ |
| 7570 | -S "SSL - Unknown identity received" \ |
| 7571 | -S "SSL - Verification of the message MAC failed" |
| 7572 | |
| 7573 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7575 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7576 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7577 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7578 | psk_identity=foo psk=abc123" \ |
| 7579 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7580 | -C "session hash for extended master secret"\ |
| 7581 | -S "session hash for extended master secret"\ |
| 7582 | -S "SSL - The handshake negotiation failed" \ |
| 7583 | -S "SSL - Unknown identity received" \ |
| 7584 | -S "SSL - Verification of the message MAC failed" |
| 7585 | |
| 7586 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7588 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7589 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7590 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7591 | psk_identity=foo psk=abc123" \ |
| 7592 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7593 | -C "session hash for extended master secret"\ |
| 7594 | -S "session hash for extended master secret"\ |
| 7595 | -S "SSL - The handshake negotiation failed" \ |
| 7596 | -S "SSL - Unknown identity received" \ |
| 7597 | -S "SSL - Verification of the message MAC failed" |
| 7598 | |
| 7599 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7601 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7602 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7603 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7604 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7605 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7606 | 0 \ |
| 7607 | -c "session hash for extended master secret"\ |
| 7608 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7609 | -S "SSL - The handshake negotiation failed" \ |
| 7610 | -S "SSL - Unknown identity received" \ |
| 7611 | -S "SSL - Verification of the message MAC failed" |
| 7612 | |
| 7613 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7615 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7616 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7617 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7618 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7619 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7620 | 0 \ |
| 7621 | -c "session hash for extended master secret"\ |
| 7622 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7623 | -S "SSL - The handshake negotiation failed" \ |
| 7624 | -S "SSL - Unknown identity received" \ |
| 7625 | -S "SSL - Verification of the message MAC failed" |
| 7626 | |
| 7627 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7629 | 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] | 7630 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7631 | "$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] | 7632 | psk_identity=def psk=beef" \ |
| 7633 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7634 | -C "session hash for extended master secret"\ |
| 7635 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7636 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7637 | -S "SSL - Unknown identity received" \ |
| 7638 | -S "SSL - Verification of the message MAC failed" |
| 7639 | |
| 7640 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7642 | 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] | 7643 | "$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" \ |
| 7644 | "$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] | 7645 | psk_identity=def psk=beef" \ |
| 7646 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7647 | -C "session hash for extended master secret"\ |
| 7648 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7649 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7650 | -S "SSL - Unknown identity received" \ |
| 7651 | -S "SSL - Verification of the message MAC failed" |
| 7652 | |
| 7653 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7655 | 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] | 7656 | "$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] | 7657 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7658 | "$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] | 7659 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7660 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7661 | -c "session hash for extended master secret"\ |
| 7662 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7663 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7664 | -S "SSL - Unknown identity received" \ |
| 7665 | -S "SSL - Verification of the message MAC failed" |
| 7666 | |
| 7667 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7669 | 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] | 7670 | "$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] | 7671 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7672 | "$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] | 7673 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7674 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7675 | -c "session hash for extended master secret"\ |
| 7676 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7677 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7678 | -S "SSL - Unknown identity received" \ |
| 7679 | -S "SSL - Verification of the message MAC failed" |
| 7680 | |
| 7681 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7683 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7684 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7685 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7686 | psk_identity=def psk=beef" \ |
| 7687 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7688 | -C "session hash for extended master secret"\ |
| 7689 | -S "session hash for extended master secret"\ |
| 7690 | -S "SSL - The handshake negotiation failed" \ |
| 7691 | -S "SSL - Unknown identity received" \ |
| 7692 | -S "SSL - Verification of the message MAC failed" |
| 7693 | |
| 7694 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7695 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7696 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7697 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7698 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7699 | psk_identity=def psk=beef" \ |
| 7700 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7701 | -C "session hash for extended master secret"\ |
| 7702 | -S "session hash for extended master secret"\ |
| 7703 | -S "SSL - The handshake negotiation failed" \ |
| 7704 | -S "SSL - Unknown identity received" \ |
| 7705 | -S "SSL - Verification of the message MAC failed" |
| 7706 | |
| 7707 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7708 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7709 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7710 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7711 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7712 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7713 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7714 | 0 \ |
| 7715 | -c "session hash for extended master secret"\ |
| 7716 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7717 | -S "SSL - The handshake negotiation failed" \ |
| 7718 | -S "SSL - Unknown identity received" \ |
| 7719 | -S "SSL - Verification of the message MAC failed" |
| 7720 | |
| 7721 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7723 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7724 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7725 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7726 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7727 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7728 | 0 \ |
| 7729 | -c "session hash for extended master secret"\ |
| 7730 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7731 | -S "SSL - The handshake negotiation failed" \ |
| 7732 | -S "SSL - Unknown identity received" \ |
| 7733 | -S "SSL - Verification of the message MAC failed" |
| 7734 | |
| 7735 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7737 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7738 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7739 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7740 | psk_identity=def psk=beef" \ |
| 7741 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7742 | -C "session hash for extended master secret"\ |
| 7743 | -S "session hash for extended master secret"\ |
| 7744 | -S "SSL - The handshake negotiation failed" \ |
| 7745 | -S "SSL - Unknown identity received" \ |
| 7746 | -S "SSL - Verification of the message MAC failed" |
| 7747 | |
| 7748 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7749 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7750 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7751 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7752 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7753 | psk_identity=def psk=beef" \ |
| 7754 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7755 | -C "session hash for extended master secret"\ |
| 7756 | -S "session hash for extended master secret"\ |
| 7757 | -S "SSL - The handshake negotiation failed" \ |
| 7758 | -S "SSL - Unknown identity received" \ |
| 7759 | -S "SSL - Verification of the message MAC failed" |
| 7760 | |
| 7761 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7763 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7764 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7765 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7766 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7767 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7768 | 0 \ |
| 7769 | -c "session hash for extended master secret"\ |
| 7770 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7771 | -S "SSL - The handshake negotiation failed" \ |
| 7772 | -S "SSL - Unknown identity received" \ |
| 7773 | -S "SSL - Verification of the message MAC failed" |
| 7774 | |
| 7775 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7776 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7777 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7778 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7779 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7780 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7781 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7782 | 0 \ |
| 7783 | -c "session hash for extended master secret"\ |
| 7784 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7785 | -S "SSL - The handshake negotiation failed" \ |
| 7786 | -S "SSL - Unknown identity received" \ |
| 7787 | -S "SSL - Verification of the message MAC failed" |
| 7788 | |
| 7789 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7791 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7792 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7793 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7794 | psk_identity=def psk=beef" \ |
| 7795 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7796 | -C "session hash for extended master secret"\ |
| 7797 | -S "session hash for extended master secret"\ |
| 7798 | -S "SSL - The handshake negotiation failed" \ |
| 7799 | -S "SSL - Unknown identity received" \ |
| 7800 | -S "SSL - Verification of the message MAC failed" |
| 7801 | |
| 7802 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7804 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7805 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7806 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7807 | psk_identity=def psk=beef" \ |
| 7808 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7809 | -C "session hash for extended master secret"\ |
| 7810 | -S "session hash for extended master secret"\ |
| 7811 | -S "SSL - The handshake negotiation failed" \ |
| 7812 | -S "SSL - Unknown identity received" \ |
| 7813 | -S "SSL - Verification of the message MAC failed" |
| 7814 | |
| 7815 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7816 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7817 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7818 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7819 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7820 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7821 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7822 | 0 \ |
| 7823 | -c "session hash for extended master secret"\ |
| 7824 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7825 | -S "SSL - The handshake negotiation failed" \ |
| 7826 | -S "SSL - Unknown identity received" \ |
| 7827 | -S "SSL - Verification of the message MAC failed" |
| 7828 | |
| 7829 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7830 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7831 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7832 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7833 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7834 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7835 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7836 | 0 \ |
| 7837 | -c "session hash for extended master secret"\ |
| 7838 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7839 | -S "SSL - The handshake negotiation failed" \ |
| 7840 | -S "SSL - Unknown identity received" \ |
| 7841 | -S "SSL - Verification of the message MAC failed" |
| 7842 | |
| 7843 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7844 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7845 | 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] | 7846 | "$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" \ |
| 7847 | "$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] | 7848 | psk_identity=def psk=beef" \ |
| 7849 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7850 | -C "session hash for extended master secret"\ |
| 7851 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7852 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7853 | -S "SSL - Unknown identity received" \ |
| 7854 | -S "SSL - Verification of the message MAC failed" |
| 7855 | |
| 7856 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7857 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7858 | 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] | 7859 | "$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" \ |
| 7860 | "$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] | 7861 | psk_identity=def psk=beef" \ |
| 7862 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7863 | -C "session hash for extended master secret"\ |
| 7864 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7865 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7866 | -S "SSL - Unknown identity received" \ |
| 7867 | -S "SSL - Verification of the message MAC failed" |
| 7868 | |
| 7869 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7871 | 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] | 7872 | "$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" \ |
| 7873 | "$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] | 7874 | psk_identity=def psk=beef" \ |
| 7875 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7876 | -C "session hash for extended master secret"\ |
| 7877 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7878 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7879 | -S "SSL - Unknown identity received" \ |
| 7880 | -S "SSL - Verification of the message MAC failed" |
| 7881 | |
| 7882 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7884 | 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] | 7885 | "$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" \ |
| 7886 | "$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] | 7887 | psk_identity=def psk=beef" \ |
| 7888 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7889 | -C "session hash for extended master secret"\ |
| 7890 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7891 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7892 | -S "SSL - Unknown identity received" \ |
| 7893 | -S "SSL - Verification of the message MAC failed" |
| 7894 | |
| 7895 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7897 | 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] | 7898 | "$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" \ |
| 7899 | "$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] | 7900 | psk_identity=def psk=beef" \ |
| 7901 | 1 \ |
| 7902 | -s "SSL - Verification of the message MAC failed" |
| 7903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7905 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7906 | "$P_SRV" \ |
| 7907 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7908 | psk_identity=foo psk=abc123" \ |
| 7909 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7910 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7911 | -S "SSL - Unknown identity received" \ |
| 7912 | -S "SSL - Verification of the message MAC failed" |
| 7913 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7915 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7916 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7917 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7918 | psk_identity=foo psk=abc123" \ |
| 7919 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7920 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7921 | -s "SSL - Unknown identity received" \ |
| 7922 | -S "SSL - Verification of the message MAC failed" |
| 7923 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7925 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7926 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7927 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7928 | psk_identity=abc psk=dead" \ |
| 7929 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7930 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7931 | -S "SSL - Unknown identity received" \ |
| 7932 | -S "SSL - Verification of the message MAC failed" |
| 7933 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7935 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7936 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7937 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7938 | psk_identity=def psk=beef" \ |
| 7939 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7940 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7941 | -S "SSL - Unknown identity received" \ |
| 7942 | -S "SSL - Verification of the message MAC failed" |
| 7943 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7945 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7946 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7947 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7948 | psk_identity=ghi psk=beef" \ |
| 7949 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7950 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7951 | -s "SSL - Unknown identity received" \ |
| 7952 | -S "SSL - Verification of the message MAC failed" |
| 7953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7955 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7956 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7957 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7958 | psk_identity=abc psk=beef" \ |
| 7959 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7960 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7961 | -S "SSL - Unknown identity received" \ |
| 7962 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7963 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7964 | # Tests for EC J-PAKE |
| 7965 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7966 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7968 | run_test "ECJPAKE: client not configured" \ |
| 7969 | "$P_SRV debug_level=3" \ |
| 7970 | "$P_CLI debug_level=3" \ |
| 7971 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 7972 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7973 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7974 | -S "found ecjpake kkpp extension" \ |
| 7975 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7976 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7977 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7978 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7979 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7980 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7981 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7983 | run_test "ECJPAKE: server not configured" \ |
| 7984 | "$P_SRV debug_level=3" \ |
| 7985 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 7986 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 7987 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 7988 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7989 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7990 | -s "found ecjpake kkpp extension" \ |
| 7991 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7992 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 7993 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 7994 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 7995 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7996 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7997 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7998 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 7999 | run_test "ECJPAKE: working, TLS" \ |
| 8000 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8001 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8002 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8003 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8004 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8005 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8006 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8007 | -s "found ecjpake kkpp extension" \ |
| 8008 | -S "skip ecjpake kkpp extension" \ |
| 8009 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8010 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8011 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8012 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8013 | -S "SSL - Verification of the message MAC failed" |
| 8014 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8015 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8016 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8017 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8018 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8019 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8020 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8021 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8022 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8023 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8024 | -s "SSL - Verification of the message MAC failed" |
| 8025 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8026 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8028 | run_test "ECJPAKE: working, DTLS" \ |
| 8029 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8030 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8031 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8032 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8033 | -c "re-using cached ecjpake parameters" \ |
| 8034 | -S "SSL - Verification of the message MAC failed" |
| 8035 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8036 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8037 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8038 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8039 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8040 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8041 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8042 | 0 \ |
| 8043 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8044 | -S "SSL - Verification of the message MAC failed" |
| 8045 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8046 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8047 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8049 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8050 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8051 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8052 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8053 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8054 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8055 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8056 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8057 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8058 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8060 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8061 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8062 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8063 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8064 | 0 |
| 8065 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8066 | # Test for ClientHello without extensions |
| 8067 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8068 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8070 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 8071 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8072 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8073 | 0 \ |
| 8074 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8075 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8076 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8077 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8078 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8079 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8080 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8081 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8082 | "$P_CLI request_size=100" \ |
| 8083 | 0 \ |
| 8084 | -s "Read from client: 100 bytes read$" |
| 8085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8087 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8088 | "$P_SRV buffer_size=100" \ |
| 8089 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8090 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8091 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8092 | |
| 8093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8094 | requires_max_content_len 200 |
| 8095 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8096 | "$P_SRV buffer_size=100" \ |
| 8097 | "$P_CLI request_size=200" \ |
| 8098 | 0 \ |
| 8099 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8100 | |
| 8101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8102 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8103 | "$P_SRV buffer_size=100" \ |
| 8104 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8105 | 0 \ |
| 8106 | -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 8107 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8108 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8109 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8110 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8111 | "$P_SRV force_version=tls12" \ |
| 8112 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8113 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8114 | 0 \ |
| 8115 | -s "Read from client: 1 bytes read" |
| 8116 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8117 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8118 | "$P_SRV force_version=tls12" \ |
| 8119 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8120 | 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] | 8121 | 0 \ |
| 8122 | -s "Read from client: 1 bytes read" |
| 8123 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8124 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8125 | "$P_SRV force_version=tls12" \ |
| 8126 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8127 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8128 | 0 \ |
| 8129 | -s "Read from client: 1 bytes read" |
| 8130 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8131 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8132 | "$P_SRV force_version=tls12" \ |
| 8133 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8134 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8135 | 0 \ |
| 8136 | -s "Read from client: 1 bytes read" |
| 8137 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8138 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8139 | "$P_SRV force_version=tls12" \ |
| 8140 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8141 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8142 | 0 \ |
| 8143 | -s "Read from client: 1 bytes read" |
| 8144 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8145 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8146 | run_test "Small client packet TLS 1.3 AEAD" \ |
| 8147 | "$P_SRV force_version=tls13" \ |
| 8148 | "$P_CLI request_size=1 \ |
| 8149 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8150 | 0 \ |
| 8151 | -s "Read from client: 1 bytes read" |
| 8152 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8153 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8154 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
| 8155 | "$P_SRV force_version=tls13" \ |
| 8156 | "$P_CLI request_size=1 \ |
| 8157 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8158 | 0 \ |
| 8159 | -s "Read from client: 1 bytes read" |
| 8160 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8161 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8162 | |
| 8163 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8164 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8165 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8166 | "$P_CLI dtls=1 request_size=1 \ |
| 8167 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8168 | 0 \ |
| 8169 | -s "Read from client: 1 bytes read" |
| 8170 | |
| 8171 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8172 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8173 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8174 | "$P_CLI dtls=1 request_size=1 \ |
| 8175 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8176 | 0 \ |
| 8177 | -s "Read from client: 1 bytes read" |
| 8178 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8179 | # Tests for small server packets |
| 8180 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8181 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8182 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8183 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8184 | 0 \ |
| 8185 | -c "Read from server: 1 bytes read" |
| 8186 | |
| 8187 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8188 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8189 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8190 | 0 \ |
| 8191 | -c "Read from server: 1 bytes read" |
| 8192 | |
| 8193 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8194 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8195 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8196 | 0 \ |
| 8197 | -c "Read from server: 1 bytes read" |
| 8198 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8199 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8200 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8201 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8202 | 0 \ |
| 8203 | -c "Read from server: 1 bytes read" |
| 8204 | |
| 8205 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8206 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8207 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8208 | 0 \ |
| 8209 | -c "Read from server: 1 bytes read" |
| 8210 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8211 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8212 | run_test "Small server packet TLS 1.3 AEAD" \ |
| 8213 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8214 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8215 | 0 \ |
| 8216 | -c "Read from server: 1 bytes read" |
| 8217 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8218 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8219 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
| 8220 | "$P_SRV response_size=1 force_version=tls13" \ |
| 8221 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8222 | 0 \ |
| 8223 | -c "Read from server: 1 bytes read" |
| 8224 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8225 | # Tests for small server packets in DTLS |
| 8226 | |
| 8227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8228 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8229 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8230 | "$P_CLI dtls=1 \ |
| 8231 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8232 | 0 \ |
| 8233 | -c "Read from server: 1 bytes read" |
| 8234 | |
| 8235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8236 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8237 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8238 | "$P_CLI dtls=1 \ |
| 8239 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8240 | 0 \ |
| 8241 | -c "Read from server: 1 bytes read" |
| 8242 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8243 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8244 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8245 | # How many fragments do we expect to write $1 bytes? |
| 8246 | fragments_for_write() { |
| 8247 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8248 | } |
| 8249 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8250 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8251 | "$P_SRV force_version=tls12" \ |
| 8252 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8254 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8255 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8256 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8257 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8258 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8259 | "$P_SRV force_version=tls12" \ |
| 8260 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8262 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8263 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8264 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8265 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8266 | "$P_SRV force_version=tls12" \ |
| 8267 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8268 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8269 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8270 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8272 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8273 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8274 | "$P_SRV force_version=tls12" \ |
| 8275 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8277 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8278 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8280 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8281 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8282 | "$P_SRV force_version=tls12" \ |
| 8283 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8284 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8285 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8286 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8287 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8288 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8289 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8290 | run_test "Large client packet TLS 1.3 AEAD" \ |
| 8291 | "$P_SRV force_version=tls13" \ |
| 8292 | "$P_CLI request_size=16384 \ |
| 8293 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8294 | 0 \ |
| 8295 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8296 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8297 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8298 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8299 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
| 8300 | "$P_SRV force_version=tls13" \ |
| 8301 | "$P_CLI request_size=16384 \ |
| 8302 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8303 | 0 \ |
| 8304 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8305 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8306 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8307 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8308 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8309 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8310 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8311 | 0 \ |
| 8312 | -c "Read from server: 16384 bytes read" |
| 8313 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8314 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8315 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8316 | "$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8317 | 0 \ |
| 8318 | -s "16384 bytes written in 1 fragments" \ |
| 8319 | -c "Read from server: 16384 bytes read" |
| 8320 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8321 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8322 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8323 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8324 | 0 \ |
| 8325 | -c "Read from server: 16384 bytes read" |
| 8326 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8327 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8328 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8329 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8330 | 0 \ |
| 8331 | -s "16384 bytes written in 1 fragments" \ |
| 8332 | -c "Read from server: 16384 bytes read" |
| 8333 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8334 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8335 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8336 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8337 | 0 \ |
| 8338 | -c "Read from server: 16384 bytes read" |
| 8339 | |
| 8340 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8341 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8342 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8343 | 0 \ |
| 8344 | -c "Read from server: 16384 bytes read" |
| 8345 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8346 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8347 | run_test "Large server packet TLS 1.3 AEAD" \ |
| 8348 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8349 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8350 | 0 \ |
| 8351 | -c "Read from server: 16384 bytes read" |
| 8352 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8353 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8354 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
| 8355 | "$P_SRV response_size=16384 force_version=tls13" \ |
| 8356 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8357 | 0 \ |
| 8358 | -c "Read from server: 16384 bytes read" |
| 8359 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8360 | # Tests for restartable ECC |
| 8361 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8362 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8363 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8364 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8365 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8367 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8368 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8369 | "$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] | 8370 | 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] | 8371 | debug_level=1" \ |
| 8372 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8373 | -C "x509_verify_cert.*4b00" \ |
| 8374 | -C "mbedtls_pk_verify.*4b00" \ |
| 8375 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8376 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8377 | |
| 8378 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8381 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8382 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8383 | "$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] | 8384 | 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] | 8385 | debug_level=1 ec_max_ops=0" \ |
| 8386 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8387 | -C "x509_verify_cert.*4b00" \ |
| 8388 | -C "mbedtls_pk_verify.*4b00" \ |
| 8389 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8390 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8391 | |
| 8392 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8393 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8394 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8395 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8396 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8397 | "$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] | 8398 | 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] | 8399 | debug_level=1 ec_max_ops=65535" \ |
| 8400 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8401 | -C "x509_verify_cert.*4b00" \ |
| 8402 | -C "mbedtls_pk_verify.*4b00" \ |
| 8403 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8404 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8405 | |
| 8406 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8407 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8409 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8410 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8411 | "$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] | 8412 | 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] | 8413 | debug_level=1 ec_max_ops=1000" \ |
| 8414 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8415 | -c "x509_verify_cert.*4b00" \ |
| 8416 | -c "mbedtls_pk_verify.*4b00" \ |
| 8417 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8418 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8419 | |
| 8420 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8421 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8423 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8424 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8425 | crt_file=data_files/server5-badsign.crt \ |
| 8426 | key_file=data_files/server5.key" \ |
| 8427 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8428 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8429 | debug_level=1 ec_max_ops=1000" \ |
| 8430 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8431 | -c "x509_verify_cert.*4b00" \ |
| 8432 | -C "mbedtls_pk_verify.*4b00" \ |
| 8433 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8434 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8435 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8436 | -c "! mbedtls_ssl_handshake returned" \ |
| 8437 | -c "X509 - Certificate verification failed" |
| 8438 | |
| 8439 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8440 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8442 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8443 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8444 | crt_file=data_files/server5-badsign.crt \ |
| 8445 | key_file=data_files/server5.key" \ |
| 8446 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8447 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8448 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8449 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8450 | -c "x509_verify_cert.*4b00" \ |
| 8451 | -c "mbedtls_pk_verify.*4b00" \ |
| 8452 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8453 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8454 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8455 | -C "! mbedtls_ssl_handshake returned" \ |
| 8456 | -C "X509 - Certificate verification failed" |
| 8457 | |
| 8458 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8459 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8461 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8462 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8463 | crt_file=data_files/server5-badsign.crt \ |
| 8464 | key_file=data_files/server5.key" \ |
| 8465 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8466 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8467 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8468 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8469 | -C "x509_verify_cert.*4b00" \ |
| 8470 | -c "mbedtls_pk_verify.*4b00" \ |
| 8471 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8472 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8473 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8474 | -C "! mbedtls_ssl_handshake returned" \ |
| 8475 | -C "X509 - Certificate verification failed" |
| 8476 | |
| 8477 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8478 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8480 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8481 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8482 | "$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] | 8483 | 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] | 8484 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8485 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8486 | -c "x509_verify_cert.*4b00" \ |
| 8487 | -c "mbedtls_pk_verify.*4b00" \ |
| 8488 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8489 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8490 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8491 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8492 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8493 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8494 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8495 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8496 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8497 | debug_level=1 ec_max_ops=1000" \ |
| 8498 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8499 | -c "x509_verify_cert.*4b00" \ |
| 8500 | -c "mbedtls_pk_verify.*4b00" \ |
| 8501 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8502 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8503 | |
| 8504 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8505 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8507 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8508 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8509 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 8510 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 8511 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8512 | -C "x509_verify_cert.*4b00" \ |
| 8513 | -C "mbedtls_pk_verify.*4b00" \ |
| 8514 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8515 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8516 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8517 | # Tests of asynchronous private key support in SSL |
| 8518 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8519 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8521 | run_test "SSL async private: sign, delay=0" \ |
| 8522 | "$P_SRV \ |
| 8523 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8524 | "$P_CLI" \ |
| 8525 | 0 \ |
| 8526 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8527 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8528 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8529 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8531 | run_test "SSL async private: sign, delay=1" \ |
| 8532 | "$P_SRV \ |
| 8533 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8534 | "$P_CLI" \ |
| 8535 | 0 \ |
| 8536 | -s "Async sign callback: using key slot " \ |
| 8537 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8538 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8539 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8540 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8542 | run_test "SSL async private: sign, delay=2" \ |
| 8543 | "$P_SRV \ |
| 8544 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8545 | "$P_CLI" \ |
| 8546 | 0 \ |
| 8547 | -s "Async sign callback: using key slot " \ |
| 8548 | -U "Async sign callback: using key slot " \ |
| 8549 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8550 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8551 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8552 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8553 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8554 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8556 | run_test "SSL async private: sign, SNI" \ |
| 8557 | "$P_SRV debug_level=3 \ |
| 8558 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8559 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8560 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8561 | "$P_CLI server_name=polarssl.example" \ |
| 8562 | 0 \ |
| 8563 | -s "Async sign callback: using key slot " \ |
| 8564 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8565 | -s "parse ServerName extension" \ |
| 8566 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8567 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8568 | |
| 8569 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8571 | run_test "SSL async private: decrypt, delay=0" \ |
| 8572 | "$P_SRV \ |
| 8573 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8574 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8575 | 0 \ |
| 8576 | -s "Async decrypt callback: using key slot " \ |
| 8577 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8578 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8579 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8581 | run_test "SSL async private: decrypt, delay=1" \ |
| 8582 | "$P_SRV \ |
| 8583 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8584 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8585 | 0 \ |
| 8586 | -s "Async decrypt callback: using key slot " \ |
| 8587 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8588 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8589 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8590 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8592 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8593 | "$P_SRV psk=abc123 \ |
| 8594 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8595 | "$P_CLI psk=abc123 \ |
| 8596 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8597 | 0 \ |
| 8598 | -s "Async decrypt callback: using key slot " \ |
| 8599 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8600 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8603 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8604 | "$P_SRV psk=abc123 \ |
| 8605 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8606 | "$P_CLI psk=abc123 \ |
| 8607 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8608 | 0 \ |
| 8609 | -s "Async decrypt callback: using key slot " \ |
| 8610 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8611 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8612 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8613 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8615 | run_test "SSL async private: sign callback not present" \ |
| 8616 | "$P_SRV \ |
| 8617 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8618 | "$P_CLI; [ \$? -eq 1 ] && |
| 8619 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8620 | 0 \ |
| 8621 | -S "Async sign callback" \ |
| 8622 | -s "! mbedtls_ssl_handshake returned" \ |
| 8623 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8624 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8625 | -s "Successful connection" |
| 8626 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8627 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8629 | run_test "SSL async private: decrypt callback not present" \ |
| 8630 | "$P_SRV debug_level=1 \ |
| 8631 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8632 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 8633 | [ \$? -eq 1 ] && $P_CLI" \ |
| 8634 | 0 \ |
| 8635 | -S "Async decrypt callback" \ |
| 8636 | -s "! mbedtls_ssl_handshake returned" \ |
| 8637 | -s "got no RSA private key" \ |
| 8638 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8639 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8640 | |
| 8641 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8644 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8645 | "$P_SRV \ |
| 8646 | async_operations=s async_private_delay1=1 \ |
| 8647 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8648 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8649 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8650 | 0 \ |
| 8651 | -s "Async sign callback: using key slot 0," \ |
| 8652 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8653 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8654 | |
| 8655 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8656 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8658 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8659 | "$P_SRV \ |
| 8660 | async_operations=s async_private_delay2=1 \ |
| 8661 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8662 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8663 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8664 | 0 \ |
| 8665 | -s "Async sign callback: using key slot 0," \ |
| 8666 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8667 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8668 | |
| 8669 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8670 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8672 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8673 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8674 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8675 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8676 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8677 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8678 | 0 \ |
| 8679 | -s "Async sign callback: using key slot 1," \ |
| 8680 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8681 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8682 | |
| 8683 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8684 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8686 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8687 | "$P_SRV \ |
| 8688 | async_operations=s async_private_delay1=1 \ |
| 8689 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8690 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8691 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8692 | 0 \ |
| 8693 | -s "Async sign callback: no key matches this certificate." |
| 8694 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8697 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8698 | "$P_SRV \ |
| 8699 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8700 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8701 | "$P_CLI" \ |
| 8702 | 1 \ |
| 8703 | -s "Async sign callback: injected error" \ |
| 8704 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8705 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8706 | -s "! mbedtls_ssl_handshake returned" |
| 8707 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8708 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8710 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8711 | "$P_SRV \ |
| 8712 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8713 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8714 | "$P_CLI" \ |
| 8715 | 1 \ |
| 8716 | -s "Async sign callback: using key slot " \ |
| 8717 | -S "Async resume" \ |
| 8718 | -s "Async cancel" |
| 8719 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8720 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8721 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8722 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8723 | "$P_SRV \ |
| 8724 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8725 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8726 | "$P_CLI" \ |
| 8727 | 1 \ |
| 8728 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8729 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8730 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8731 | -s "! mbedtls_ssl_handshake returned" |
| 8732 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8734 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8735 | run_test "SSL async private: decrypt, error in start" \ |
| 8736 | "$P_SRV \ |
| 8737 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8738 | async_private_error=1" \ |
| 8739 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8740 | 1 \ |
| 8741 | -s "Async decrypt callback: injected error" \ |
| 8742 | -S "Async resume" \ |
| 8743 | -S "Async cancel" \ |
| 8744 | -s "! mbedtls_ssl_handshake returned" |
| 8745 | |
| 8746 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8748 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8749 | "$P_SRV \ |
| 8750 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8751 | async_private_error=2" \ |
| 8752 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8753 | 1 \ |
| 8754 | -s "Async decrypt callback: using key slot " \ |
| 8755 | -S "Async resume" \ |
| 8756 | -s "Async cancel" |
| 8757 | |
| 8758 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8760 | run_test "SSL async private: decrypt, error in resume" \ |
| 8761 | "$P_SRV \ |
| 8762 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8763 | async_private_error=3" \ |
| 8764 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8765 | 1 \ |
| 8766 | -s "Async decrypt callback: using key slot " \ |
| 8767 | -s "Async resume callback: decrypt done but injected error" \ |
| 8768 | -S "Async cancel" \ |
| 8769 | -s "! mbedtls_ssl_handshake returned" |
| 8770 | |
| 8771 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8772 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8773 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8774 | "$P_SRV \ |
| 8775 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8776 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8777 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8778 | 0 \ |
| 8779 | -s "Async cancel" \ |
| 8780 | -s "! mbedtls_ssl_handshake returned" \ |
| 8781 | -s "Async resume" \ |
| 8782 | -s "Successful connection" |
| 8783 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8784 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8786 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8787 | "$P_SRV \ |
| 8788 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8789 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8790 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8791 | 0 \ |
| 8792 | -s "! mbedtls_ssl_handshake returned" \ |
| 8793 | -s "Async resume" \ |
| 8794 | -s "Successful connection" |
| 8795 | |
| 8796 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8797 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8798 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8799 | 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] | 8800 | "$P_SRV \ |
| 8801 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8802 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8803 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8804 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8805 | [ \$? -eq 1 ] && |
| 8806 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8807 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8808 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8809 | -S "Async resume" \ |
| 8810 | -s "Async cancel" \ |
| 8811 | -s "! mbedtls_ssl_handshake returned" \ |
| 8812 | -s "Async sign callback: no key matches this certificate." \ |
| 8813 | -s "Successful connection" |
| 8814 | |
| 8815 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8816 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8818 | 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] | 8819 | "$P_SRV \ |
| 8820 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 8821 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8822 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8823 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8824 | [ \$? -eq 1 ] && |
| 8825 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8826 | 0 \ |
| 8827 | -s "Async resume" \ |
| 8828 | -s "! mbedtls_ssl_handshake returned" \ |
| 8829 | -s "Async sign callback: no key matches this certificate." \ |
| 8830 | -s "Successful connection" |
| 8831 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8832 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8833 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8835 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8836 | "$P_SRV \ |
| 8837 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8838 | exchanges=2 renegotiation=1" \ |
| 8839 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8840 | 0 \ |
| 8841 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8842 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8843 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8844 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8845 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8847 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8848 | "$P_SRV \ |
| 8849 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8850 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8851 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8852 | 0 \ |
| 8853 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8854 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8855 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8856 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8859 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8860 | "$P_SRV \ |
| 8861 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8862 | exchanges=2 renegotiation=1" \ |
| 8863 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8864 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8865 | 0 \ |
| 8866 | -s "Async decrypt callback: using key slot " \ |
| 8867 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8868 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8869 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8870 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8872 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8873 | "$P_SRV \ |
| 8874 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8875 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8876 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8877 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8878 | 0 \ |
| 8879 | -s "Async decrypt callback: using key slot " \ |
| 8880 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8881 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8882 | # Tests for ECC extensions (rfc 4492) |
| 8883 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8884 | requires_config_enabled MBEDTLS_AES_C |
| 8885 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8886 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8887 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8889 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8890 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8891 | "$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] | 8892 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8893 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8894 | -C "client hello, adding supported_point_formats extension" \ |
| 8895 | -S "found supported elliptic curves extension" \ |
| 8896 | -S "found supported point formats extension" |
| 8897 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8898 | requires_config_enabled MBEDTLS_AES_C |
| 8899 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8900 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8901 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8903 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8904 | "$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] | 8905 | "$P_CLI debug_level=3" \ |
| 8906 | 0 \ |
| 8907 | -C "found supported_point_formats extension" \ |
| 8908 | -S "server hello, supported_point_formats extension" |
| 8909 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8910 | requires_config_enabled MBEDTLS_AES_C |
| 8911 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8912 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8913 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8914 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8915 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8916 | "$P_SRV debug_level=3" \ |
| 8917 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8918 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 8919 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8920 | -c "client hello, adding supported_point_formats extension" \ |
| 8921 | -s "found supported elliptic curves extension" \ |
| 8922 | -s "found supported point formats extension" |
| 8923 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8924 | requires_config_enabled MBEDTLS_AES_C |
| 8925 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 8926 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8927 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8929 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8930 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8931 | "$P_CLI debug_level=3" \ |
| 8932 | 0 \ |
| 8933 | -c "found supported_point_formats extension" \ |
| 8934 | -s "server hello, supported_point_formats extension" |
| 8935 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8936 | # Tests for DTLS HelloVerifyRequest |
| 8937 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8938 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8939 | run_test "DTLS cookie: enabled" \ |
| 8940 | "$P_SRV dtls=1 debug_level=2" \ |
| 8941 | "$P_CLI dtls=1 debug_level=2" \ |
| 8942 | 0 \ |
| 8943 | -s "cookie verification failed" \ |
| 8944 | -s "cookie verification passed" \ |
| 8945 | -S "cookie verification skipped" \ |
| 8946 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8947 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8948 | -S "SSL - The requested feature is not available" |
| 8949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8951 | run_test "DTLS cookie: disabled" \ |
| 8952 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8953 | "$P_CLI dtls=1 debug_level=2" \ |
| 8954 | 0 \ |
| 8955 | -S "cookie verification failed" \ |
| 8956 | -S "cookie verification passed" \ |
| 8957 | -s "cookie verification skipped" \ |
| 8958 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8959 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8960 | -S "SSL - The requested feature is not available" |
| 8961 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8963 | run_test "DTLS cookie: default (failing)" \ |
| 8964 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8965 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8966 | 1 \ |
| 8967 | -s "cookie verification failed" \ |
| 8968 | -S "cookie verification passed" \ |
| 8969 | -S "cookie verification skipped" \ |
| 8970 | -C "received hello verify request" \ |
| 8971 | -S "hello verification requested" \ |
| 8972 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8973 | |
| 8974 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8975 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8976 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8977 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8978 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8979 | 0 \ |
| 8980 | -s "cookie verification failed" \ |
| 8981 | -s "cookie verification passed" \ |
| 8982 | -S "cookie verification skipped" \ |
| 8983 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8984 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8985 | -S "SSL - The requested feature is not available" |
| 8986 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8987 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8988 | run_test "DTLS cookie: enabled, nbio" \ |
| 8989 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8990 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8991 | 0 \ |
| 8992 | -s "cookie verification failed" \ |
| 8993 | -s "cookie verification passed" \ |
| 8994 | -S "cookie verification skipped" \ |
| 8995 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8996 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8997 | -S "SSL - The requested feature is not available" |
| 8998 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8999 | # Tests for client reconnecting from the same port with DTLS |
| 9000 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9001 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9003 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9004 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9005 | "$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] | 9006 | 0 \ |
| 9007 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9008 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9009 | -S "Client initiated reconnection from same port" |
| 9010 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9011 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9013 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9014 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9015 | "$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] | 9016 | 0 \ |
| 9017 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9018 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9019 | -s "Client initiated reconnection from same port" |
| 9020 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9021 | 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] | 9022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9023 | 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] | 9024 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9025 | "$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] | 9026 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9027 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9028 | -s "Client initiated reconnection from same port" |
| 9029 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9030 | 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] | 9031 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9032 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9033 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9034 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9035 | 0 \ |
| 9036 | -S "The operation timed out" \ |
| 9037 | -s "Client initiated reconnection from same port" |
| 9038 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9040 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9041 | "$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] | 9042 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9043 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9044 | -s "The operation timed out" \ |
| 9045 | -S "Client initiated reconnection from same port" |
| 9046 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9048 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9049 | -p "$P_PXY inject_clihlo=1" \ |
| 9050 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9051 | "$P_CLI dtls=1 exchanges=2" \ |
| 9052 | 0 \ |
| 9053 | -s "possible client reconnect from the same port" \ |
| 9054 | -S "Client initiated reconnection from same port" |
| 9055 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9056 | # Tests for various cases of client authentication with DTLS |
| 9057 | # (focused on handshake flows and message parsing) |
| 9058 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9060 | run_test "DTLS client auth: required" \ |
| 9061 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9062 | "$P_CLI dtls=1" \ |
| 9063 | 0 \ |
| 9064 | -s "Verifying peer X.509 certificate... ok" |
| 9065 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9066 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9067 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9068 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9069 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9070 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9071 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9072 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9073 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9074 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9075 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9076 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9077 | 0 \ |
| 9078 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9079 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9080 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9082 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9083 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9084 | "$P_CLI dtls=1 psk=abc124" \ |
| 9085 | 1 \ |
| 9086 | -s "SSL - Verification of the message MAC failed" \ |
| 9087 | -c "SSL - A fatal alert message was received from our peer" |
| 9088 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9089 | # Tests for receiving fragmented handshake messages with DTLS |
| 9090 | |
| 9091 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9092 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9093 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9094 | "$G_SRV -u --mtu 2048 -a" \ |
| 9095 | "$P_CLI dtls=1 debug_level=2" \ |
| 9096 | 0 \ |
| 9097 | -C "found fragmented DTLS handshake message" \ |
| 9098 | -C "error" |
| 9099 | |
| 9100 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9102 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9103 | "$G_SRV -u --mtu 512" \ |
| 9104 | "$P_CLI dtls=1 debug_level=2" \ |
| 9105 | 0 \ |
| 9106 | -c "found fragmented DTLS handshake message" \ |
| 9107 | -C "error" |
| 9108 | |
| 9109 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9111 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9112 | "$G_SRV -u --mtu 128" \ |
| 9113 | "$P_CLI dtls=1 debug_level=2" \ |
| 9114 | 0 \ |
| 9115 | -c "found fragmented DTLS handshake message" \ |
| 9116 | -C "error" |
| 9117 | |
| 9118 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9120 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9121 | "$G_SRV -u --mtu 128" \ |
| 9122 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9123 | 0 \ |
| 9124 | -c "found fragmented DTLS handshake message" \ |
| 9125 | -C "error" |
| 9126 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9127 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9128 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9130 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9131 | "$G_SRV -u --mtu 256" \ |
| 9132 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9133 | 0 \ |
| 9134 | -c "found fragmented DTLS handshake message" \ |
| 9135 | -c "client hello, adding renegotiation extension" \ |
| 9136 | -c "found renegotiation extension" \ |
| 9137 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9138 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9139 | -C "error" \ |
| 9140 | -s "Extra-header:" |
| 9141 | |
| 9142 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9143 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9145 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9146 | "$G_SRV -u --mtu 256" \ |
| 9147 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9148 | 0 \ |
| 9149 | -c "found fragmented DTLS handshake message" \ |
| 9150 | -c "client hello, adding renegotiation extension" \ |
| 9151 | -c "found renegotiation extension" \ |
| 9152 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9153 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9154 | -C "error" \ |
| 9155 | -s "Extra-header:" |
| 9156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9158 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9159 | "$O_SRV -dtls -mtu 2048" \ |
| 9160 | "$P_CLI dtls=1 debug_level=2" \ |
| 9161 | 0 \ |
| 9162 | -C "found fragmented DTLS handshake message" \ |
| 9163 | -C "error" |
| 9164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9166 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 9167 | "$O_SRV -dtls -mtu 768" \ |
| 9168 | "$P_CLI dtls=1 debug_level=2" \ |
| 9169 | 0 \ |
| 9170 | -c "found fragmented DTLS handshake message" \ |
| 9171 | -C "error" |
| 9172 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9174 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9175 | "$O_SRV -dtls -mtu 256" \ |
| 9176 | "$P_CLI dtls=1 debug_level=2" \ |
| 9177 | 0 \ |
| 9178 | -c "found fragmented DTLS handshake message" \ |
| 9179 | -C "error" |
| 9180 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9181 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9182 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9183 | "$O_SRV -dtls -mtu 256" \ |
| 9184 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9185 | 0 \ |
| 9186 | -c "found fragmented DTLS handshake message" \ |
| 9187 | -C "error" |
| 9188 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9189 | # Tests for sending fragmented handshake messages with DTLS |
| 9190 | # |
| 9191 | # Use client auth when we need the client to send large messages, |
| 9192 | # and use large cert chains on both sides too (the long chains we have all use |
| 9193 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9194 | # Sizes reached (UDP payload): |
| 9195 | # - 2037B for server certificate |
| 9196 | # - 1542B for client certificate |
| 9197 | # - 1013B for newsessionticket |
| 9198 | # - all others below 512B |
| 9199 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9200 | |
| 9201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9202 | requires_config_enabled MBEDTLS_RSA_C |
| 9203 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9204 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9205 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9207 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9208 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9209 | crt_file=data_files/server7_int-ca.crt \ |
| 9210 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9211 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9212 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9213 | "$P_CLI dtls=1 debug_level=2 \ |
| 9214 | crt_file=data_files/server8_int-ca2.crt \ |
| 9215 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9216 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9217 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9218 | 0 \ |
| 9219 | -S "found fragmented DTLS handshake message" \ |
| 9220 | -C "found fragmented DTLS handshake message" \ |
| 9221 | -C "error" |
| 9222 | |
| 9223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9224 | requires_config_enabled MBEDTLS_RSA_C |
| 9225 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9226 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9227 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9229 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9230 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9231 | crt_file=data_files/server7_int-ca.crt \ |
| 9232 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9233 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9234 | max_frag_len=1024" \ |
| 9235 | "$P_CLI dtls=1 debug_level=2 \ |
| 9236 | crt_file=data_files/server8_int-ca2.crt \ |
| 9237 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9238 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9239 | max_frag_len=2048" \ |
| 9240 | 0 \ |
| 9241 | -S "found fragmented DTLS handshake message" \ |
| 9242 | -c "found fragmented DTLS handshake message" \ |
| 9243 | -C "error" |
| 9244 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9245 | # With the MFL extension, the server has no way of forcing |
| 9246 | # the client to not exceed a certain MTU; hence, the following |
| 9247 | # test can't be replicated with an MTU proxy such as the one |
| 9248 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9249 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9250 | requires_config_enabled MBEDTLS_RSA_C |
| 9251 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9252 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9253 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9255 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9256 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9257 | crt_file=data_files/server7_int-ca.crt \ |
| 9258 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9259 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9260 | max_frag_len=512" \ |
| 9261 | "$P_CLI dtls=1 debug_level=2 \ |
| 9262 | crt_file=data_files/server8_int-ca2.crt \ |
| 9263 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9264 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9265 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9266 | 0 \ |
| 9267 | -S "found fragmented DTLS handshake message" \ |
| 9268 | -c "found fragmented DTLS handshake message" \ |
| 9269 | -C "error" |
| 9270 | |
| 9271 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9272 | requires_config_enabled MBEDTLS_RSA_C |
| 9273 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9274 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9275 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9276 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9277 | 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] | 9278 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9279 | crt_file=data_files/server7_int-ca.crt \ |
| 9280 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9281 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9282 | max_frag_len=2048" \ |
| 9283 | "$P_CLI dtls=1 debug_level=2 \ |
| 9284 | crt_file=data_files/server8_int-ca2.crt \ |
| 9285 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9286 | hs_timeout=2500-60000 \ |
| 9287 | max_frag_len=1024" \ |
| 9288 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9289 | -S "found fragmented DTLS handshake message" \ |
| 9290 | -c "found fragmented DTLS handshake message" \ |
| 9291 | -C "error" |
| 9292 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9293 | # While not required by the standard defining the MFL extension |
| 9294 | # (according to which it only applies to records, not to datagrams), |
| 9295 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9296 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9297 | # to the peer. |
| 9298 | # The next test checks that no datagrams significantly larger than the |
| 9299 | # negotiated MFL are sent. |
| 9300 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9301 | requires_config_enabled MBEDTLS_RSA_C |
| 9302 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9303 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9304 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9305 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9306 | 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] | 9307 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9308 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9309 | crt_file=data_files/server7_int-ca.crt \ |
| 9310 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9311 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9312 | max_frag_len=2048" \ |
| 9313 | "$P_CLI dtls=1 debug_level=2 \ |
| 9314 | crt_file=data_files/server8_int-ca2.crt \ |
| 9315 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9316 | hs_timeout=2500-60000 \ |
| 9317 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9318 | 0 \ |
| 9319 | -S "found fragmented DTLS handshake message" \ |
| 9320 | -c "found fragmented DTLS handshake message" \ |
| 9321 | -C "error" |
| 9322 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9323 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9324 | requires_config_enabled MBEDTLS_RSA_C |
| 9325 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9326 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9327 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9329 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9330 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9331 | crt_file=data_files/server7_int-ca.crt \ |
| 9332 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9333 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9334 | max_frag_len=2048" \ |
| 9335 | "$P_CLI dtls=1 debug_level=2 \ |
| 9336 | crt_file=data_files/server8_int-ca2.crt \ |
| 9337 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9338 | hs_timeout=2500-60000 \ |
| 9339 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9340 | 0 \ |
| 9341 | -s "found fragmented DTLS handshake message" \ |
| 9342 | -c "found fragmented DTLS handshake message" \ |
| 9343 | -C "error" |
| 9344 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9345 | # While not required by the standard defining the MFL extension |
| 9346 | # (according to which it only applies to records, not to datagrams), |
| 9347 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9348 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9349 | # to the peer. |
| 9350 | # The next test checks that no datagrams significantly larger than the |
| 9351 | # negotiated MFL are sent. |
| 9352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9353 | requires_config_enabled MBEDTLS_RSA_C |
| 9354 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9355 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9356 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9358 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9359 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9360 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9361 | crt_file=data_files/server7_int-ca.crt \ |
| 9362 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9363 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9364 | max_frag_len=2048" \ |
| 9365 | "$P_CLI dtls=1 debug_level=2 \ |
| 9366 | crt_file=data_files/server8_int-ca2.crt \ |
| 9367 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9368 | hs_timeout=2500-60000 \ |
| 9369 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9370 | 0 \ |
| 9371 | -s "found fragmented DTLS handshake message" \ |
| 9372 | -c "found fragmented DTLS handshake message" \ |
| 9373 | -C "error" |
| 9374 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9375 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9376 | requires_config_enabled MBEDTLS_RSA_C |
| 9377 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9378 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9380 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9381 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9382 | crt_file=data_files/server7_int-ca.crt \ |
| 9383 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9384 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9385 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9386 | "$P_CLI dtls=1 debug_level=2 \ |
| 9387 | crt_file=data_files/server8_int-ca2.crt \ |
| 9388 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9389 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9390 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9391 | 0 \ |
| 9392 | -S "found fragmented DTLS handshake message" \ |
| 9393 | -C "found fragmented DTLS handshake message" \ |
| 9394 | -C "error" |
| 9395 | |
| 9396 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9397 | requires_config_enabled MBEDTLS_RSA_C |
| 9398 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9399 | requires_max_content_len 4096 |
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 | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9401 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9402 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9403 | crt_file=data_files/server7_int-ca.crt \ |
| 9404 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9405 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9406 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9407 | "$P_CLI dtls=1 debug_level=2 \ |
| 9408 | crt_file=data_files/server8_int-ca2.crt \ |
| 9409 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9410 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9411 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9412 | 0 \ |
| 9413 | -s "found fragmented DTLS handshake message" \ |
| 9414 | -C "found fragmented DTLS handshake message" \ |
| 9415 | -C "error" |
| 9416 | |
| 9417 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9418 | requires_config_enabled MBEDTLS_RSA_C |
| 9419 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9420 | requires_max_content_len 2048 |
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 | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9422 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9423 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9424 | crt_file=data_files/server7_int-ca.crt \ |
| 9425 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9426 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9427 | mtu=512" \ |
| 9428 | "$P_CLI dtls=1 debug_level=2 \ |
| 9429 | crt_file=data_files/server8_int-ca2.crt \ |
| 9430 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9431 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9432 | mtu=2048" \ |
| 9433 | 0 \ |
| 9434 | -S "found fragmented DTLS handshake message" \ |
| 9435 | -c "found fragmented DTLS handshake message" \ |
| 9436 | -C "error" |
| 9437 | |
| 9438 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9439 | requires_config_enabled MBEDTLS_RSA_C |
| 9440 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9441 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9442 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9443 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9444 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9445 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9446 | crt_file=data_files/server7_int-ca.crt \ |
| 9447 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9448 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9449 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9450 | "$P_CLI dtls=1 debug_level=2 \ |
| 9451 | crt_file=data_files/server8_int-ca2.crt \ |
| 9452 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9453 | hs_timeout=2500-60000 \ |
| 9454 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9455 | 0 \ |
| 9456 | -s "found fragmented DTLS handshake message" \ |
| 9457 | -c "found fragmented DTLS handshake message" \ |
| 9458 | -C "error" |
| 9459 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9460 | # 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] | 9461 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9462 | requires_config_enabled MBEDTLS_RSA_C |
| 9463 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9464 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9465 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9466 | requires_config_enabled MBEDTLS_AES_C |
| 9467 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9468 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9470 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9471 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9472 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9473 | crt_file=data_files/server7_int-ca.crt \ |
| 9474 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9475 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9476 | mtu=512" \ |
| 9477 | "$P_CLI dtls=1 debug_level=2 \ |
| 9478 | crt_file=data_files/server8_int-ca2.crt \ |
| 9479 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9480 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9481 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9482 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9483 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9484 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9485 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9486 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9487 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9488 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9489 | # 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] | 9490 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9491 | # retransmissions, but in some cases (like both the server and client using |
| 9492 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9493 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9494 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9495 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9496 | requires_config_enabled MBEDTLS_RSA_C |
| 9497 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9498 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9499 | requires_config_enabled MBEDTLS_AES_C |
| 9500 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9501 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9503 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9504 | -p "$P_PXY mtu=508" \ |
| 9505 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9506 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9507 | key_file=data_files/server7.key \ |
| 9508 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9509 | "$P_CLI dtls=1 debug_level=2 \ |
| 9510 | crt_file=data_files/server8_int-ca2.crt \ |
| 9511 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9512 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9513 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9514 | 0 \ |
| 9515 | -s "found fragmented DTLS handshake message" \ |
| 9516 | -c "found fragmented DTLS handshake message" \ |
| 9517 | -C "error" |
| 9518 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9519 | # 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] | 9520 | only_with_valgrind |
| 9521 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9522 | requires_config_enabled MBEDTLS_RSA_C |
| 9523 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9524 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9525 | requires_config_enabled MBEDTLS_AES_C |
| 9526 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9527 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9529 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9530 | -p "$P_PXY mtu=508" \ |
| 9531 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9532 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9533 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9534 | hs_timeout=250-10000" \ |
| 9535 | "$P_CLI dtls=1 debug_level=2 \ |
| 9536 | crt_file=data_files/server8_int-ca2.crt \ |
| 9537 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9538 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9539 | hs_timeout=250-10000" \ |
| 9540 | 0 \ |
| 9541 | -s "found fragmented DTLS handshake message" \ |
| 9542 | -c "found fragmented DTLS handshake message" \ |
| 9543 | -C "error" |
| 9544 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9545 | # 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] | 9546 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9547 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9548 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9549 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9550 | requires_config_enabled MBEDTLS_RSA_C |
| 9551 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9552 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9554 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9555 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9556 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9557 | crt_file=data_files/server7_int-ca.crt \ |
| 9558 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9559 | hs_timeout=10000-60000 \ |
| 9560 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9561 | "$P_CLI dtls=1 debug_level=2 \ |
| 9562 | crt_file=data_files/server8_int-ca2.crt \ |
| 9563 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9564 | hs_timeout=10000-60000 \ |
| 9565 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9566 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9567 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9568 | -s "found fragmented DTLS handshake message" \ |
| 9569 | -c "found fragmented DTLS handshake message" \ |
| 9570 | -C "error" |
| 9571 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9572 | # 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] | 9573 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9574 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9575 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9576 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9577 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9578 | requires_config_enabled MBEDTLS_RSA_C |
| 9579 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9581 | requires_config_enabled MBEDTLS_AES_C |
| 9582 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9583 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9585 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9586 | -p "$P_PXY mtu=512" \ |
| 9587 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9588 | crt_file=data_files/server7_int-ca.crt \ |
| 9589 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9590 | hs_timeout=10000-60000 \ |
| 9591 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9592 | "$P_CLI dtls=1 debug_level=2 \ |
| 9593 | crt_file=data_files/server8_int-ca2.crt \ |
| 9594 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9595 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9596 | hs_timeout=10000-60000 \ |
| 9597 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9598 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9599 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9600 | -s "found fragmented DTLS handshake message" \ |
| 9601 | -c "found fragmented DTLS handshake message" \ |
| 9602 | -C "error" |
| 9603 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9604 | not_with_valgrind # spurious autoreduction due to timeout |
| 9605 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9606 | requires_config_enabled MBEDTLS_RSA_C |
| 9607 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9608 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9610 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9611 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9612 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9613 | crt_file=data_files/server7_int-ca.crt \ |
| 9614 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9615 | hs_timeout=10000-60000 \ |
| 9616 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9617 | "$P_CLI dtls=1 debug_level=2 \ |
| 9618 | crt_file=data_files/server8_int-ca2.crt \ |
| 9619 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9620 | hs_timeout=10000-60000 \ |
| 9621 | mtu=1024 nbio=2" \ |
| 9622 | 0 \ |
| 9623 | -S "autoreduction" \ |
| 9624 | -s "found fragmented DTLS handshake message" \ |
| 9625 | -c "found fragmented DTLS handshake message" \ |
| 9626 | -C "error" |
| 9627 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9628 | # 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] | 9629 | not_with_valgrind # spurious autoreduction due to timeout |
| 9630 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9631 | requires_config_enabled MBEDTLS_RSA_C |
| 9632 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9633 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9634 | requires_config_enabled MBEDTLS_AES_C |
| 9635 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9636 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9637 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9638 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9639 | -p "$P_PXY mtu=512" \ |
| 9640 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9641 | crt_file=data_files/server7_int-ca.crt \ |
| 9642 | key_file=data_files/server7.key \ |
| 9643 | hs_timeout=10000-60000 \ |
| 9644 | mtu=512 nbio=2" \ |
| 9645 | "$P_CLI dtls=1 debug_level=2 \ |
| 9646 | crt_file=data_files/server8_int-ca2.crt \ |
| 9647 | key_file=data_files/server8.key \ |
| 9648 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9649 | hs_timeout=10000-60000 \ |
| 9650 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9651 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9652 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9653 | -s "found fragmented DTLS handshake message" \ |
| 9654 | -c "found fragmented DTLS handshake message" \ |
| 9655 | -C "error" |
| 9656 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9657 | # 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] | 9658 | # This ensures things still work after session_reset(). |
| 9659 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9660 | # Since we don't support reading fragmented ClientHello yet, |
| 9661 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9662 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9663 | # An autoreduction on the client-side might happen if the server is |
| 9664 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9665 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9666 | # resumed listening, which would result in a spurious autoreduction. |
| 9667 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9668 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9669 | requires_config_enabled MBEDTLS_RSA_C |
| 9670 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9671 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9672 | requires_config_enabled MBEDTLS_AES_C |
| 9673 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9674 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9676 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9677 | -p "$P_PXY mtu=1450" \ |
| 9678 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9679 | crt_file=data_files/server7_int-ca.crt \ |
| 9680 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9681 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9682 | mtu=1450" \ |
| 9683 | "$P_CLI dtls=1 debug_level=2 \ |
| 9684 | crt_file=data_files/server8_int-ca2.crt \ |
| 9685 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9686 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9687 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9688 | 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] | 9689 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9690 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9691 | -s "found fragmented DTLS handshake message" \ |
| 9692 | -c "found fragmented DTLS handshake message" \ |
| 9693 | -C "error" |
| 9694 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9695 | # An autoreduction on the client-side might happen if the server is |
| 9696 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9697 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9698 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9699 | requires_config_enabled MBEDTLS_RSA_C |
| 9700 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9701 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9702 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9703 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9704 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9705 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9707 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9708 | -p "$P_PXY mtu=512" \ |
| 9709 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9710 | crt_file=data_files/server7_int-ca.crt \ |
| 9711 | key_file=data_files/server7.key \ |
| 9712 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9713 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9714 | mtu=512" \ |
| 9715 | "$P_CLI dtls=1 debug_level=2 \ |
| 9716 | crt_file=data_files/server8_int-ca2.crt \ |
| 9717 | key_file=data_files/server8.key \ |
| 9718 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9719 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9720 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9721 | mtu=512" \ |
| 9722 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9723 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9724 | -s "found fragmented DTLS handshake message" \ |
| 9725 | -c "found fragmented DTLS handshake message" \ |
| 9726 | -C "error" |
| 9727 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9728 | # An autoreduction on the client-side might happen if the server is |
| 9729 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9730 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9731 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9732 | requires_config_enabled MBEDTLS_RSA_C |
| 9733 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9734 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9735 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9736 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9737 | requires_config_enabled MBEDTLS_AES_C |
| 9738 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9739 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9740 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9741 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9742 | -p "$P_PXY mtu=512" \ |
| 9743 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9744 | crt_file=data_files/server7_int-ca.crt \ |
| 9745 | key_file=data_files/server7.key \ |
| 9746 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9747 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9748 | mtu=512" \ |
| 9749 | "$P_CLI dtls=1 debug_level=2 \ |
| 9750 | crt_file=data_files/server8_int-ca2.crt \ |
| 9751 | key_file=data_files/server8.key \ |
| 9752 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9753 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9754 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9755 | mtu=512" \ |
| 9756 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9757 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9758 | -s "found fragmented DTLS handshake message" \ |
| 9759 | -c "found fragmented DTLS handshake message" \ |
| 9760 | -C "error" |
| 9761 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9762 | # An autoreduction on the client-side might happen if the server is |
| 9763 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9764 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9766 | requires_config_enabled MBEDTLS_RSA_C |
| 9767 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9768 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9769 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9770 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9771 | requires_config_enabled MBEDTLS_AES_C |
| 9772 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9773 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9775 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9776 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9777 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9778 | crt_file=data_files/server7_int-ca.crt \ |
| 9779 | key_file=data_files/server7.key \ |
| 9780 | exchanges=2 renegotiation=1 \ |
| 9781 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9782 | hs_timeout=10000-60000 \ |
| 9783 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9784 | "$P_CLI dtls=1 debug_level=2 \ |
| 9785 | crt_file=data_files/server8_int-ca2.crt \ |
| 9786 | key_file=data_files/server8.key \ |
| 9787 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9788 | hs_timeout=10000-60000 \ |
| 9789 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9790 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9791 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9792 | -s "found fragmented DTLS handshake message" \ |
| 9793 | -c "found fragmented DTLS handshake message" \ |
| 9794 | -C "error" |
| 9795 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9796 | # An autoreduction on the client-side might happen if the server is |
| 9797 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9798 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9799 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9800 | requires_config_enabled MBEDTLS_RSA_C |
| 9801 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9802 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9803 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9804 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9805 | requires_config_enabled MBEDTLS_AES_C |
| 9806 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9807 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9808 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9809 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9810 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9811 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9812 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9813 | crt_file=data_files/server7_int-ca.crt \ |
| 9814 | key_file=data_files/server7.key \ |
| 9815 | exchanges=2 renegotiation=1 \ |
| 9816 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9817 | hs_timeout=10000-60000 \ |
| 9818 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9819 | "$P_CLI dtls=1 debug_level=2 \ |
| 9820 | crt_file=data_files/server8_int-ca2.crt \ |
| 9821 | key_file=data_files/server8.key \ |
| 9822 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9823 | hs_timeout=10000-60000 \ |
| 9824 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9825 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9826 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9827 | -s "found fragmented DTLS handshake message" \ |
| 9828 | -c "found fragmented DTLS handshake message" \ |
| 9829 | -C "error" |
| 9830 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9831 | # An autoreduction on the client-side might happen if the server is |
| 9832 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9833 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9834 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9835 | requires_config_enabled MBEDTLS_RSA_C |
| 9836 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9837 | requires_hash_alg SHA_256 |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9838 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9839 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9840 | requires_config_enabled MBEDTLS_AES_C |
| 9841 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9842 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9843 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9844 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9845 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9846 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9847 | crt_file=data_files/server7_int-ca.crt \ |
| 9848 | key_file=data_files/server7.key \ |
| 9849 | exchanges=2 renegotiation=1 \ |
| 9850 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9851 | hs_timeout=10000-60000 \ |
| 9852 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9853 | "$P_CLI dtls=1 debug_level=2 \ |
| 9854 | crt_file=data_files/server8_int-ca2.crt \ |
| 9855 | key_file=data_files/server8.key \ |
| 9856 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9857 | hs_timeout=10000-60000 \ |
| 9858 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9859 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9860 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9861 | -s "found fragmented DTLS handshake message" \ |
| 9862 | -c "found fragmented DTLS handshake message" \ |
| 9863 | -C "error" |
| 9864 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9865 | # 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] | 9866 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9867 | requires_config_enabled MBEDTLS_RSA_C |
| 9868 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9869 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9870 | requires_config_enabled MBEDTLS_AES_C |
| 9871 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9872 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9873 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9875 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9876 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9877 | "$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] | 9878 | crt_file=data_files/server7_int-ca.crt \ |
| 9879 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9880 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9881 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9882 | crt_file=data_files/server8_int-ca2.crt \ |
| 9883 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9884 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9885 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9886 | 0 \ |
| 9887 | -s "found fragmented DTLS handshake message" \ |
| 9888 | -c "found fragmented DTLS handshake message" \ |
| 9889 | -C "error" |
| 9890 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9891 | # 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] | 9892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9893 | requires_config_enabled MBEDTLS_RSA_C |
| 9894 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9895 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9896 | requires_config_enabled MBEDTLS_AES_C |
| 9897 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9898 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9899 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9901 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9902 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9903 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9904 | crt_file=data_files/server7_int-ca.crt \ |
| 9905 | key_file=data_files/server7.key \ |
| 9906 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9907 | "$P_CLI dtls=1 debug_level=2 \ |
| 9908 | crt_file=data_files/server8_int-ca2.crt \ |
| 9909 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9910 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9911 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9912 | 0 \ |
| 9913 | -s "found fragmented DTLS handshake message" \ |
| 9914 | -c "found fragmented DTLS handshake message" \ |
| 9915 | -C "error" |
| 9916 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9917 | # interop tests for DTLS fragmentating with reliable connection |
| 9918 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9919 | # here and below we just want to test that the we fragment in a way that |
| 9920 | # pleases other implementations, so we don't need the peer to fragment |
| 9921 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9922 | requires_config_enabled MBEDTLS_RSA_C |
| 9923 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9924 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9925 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9926 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9927 | "$G_SRV -u" \ |
| 9928 | "$P_CLI dtls=1 debug_level=2 \ |
| 9929 | crt_file=data_files/server8_int-ca2.crt \ |
| 9930 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9931 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9932 | 0 \ |
| 9933 | -c "fragmenting handshake message" \ |
| 9934 | -C "error" |
| 9935 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9936 | # We use --insecure for the GnuTLS client because it expects |
| 9937 | # the hostname / IP it connects to to be the name used in the |
| 9938 | # certificate obtained from the server. Here, however, it |
| 9939 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9940 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9941 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9942 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9943 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9944 | requires_config_enabled MBEDTLS_RSA_C |
| 9945 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9946 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9947 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9948 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9949 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9950 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9951 | crt_file=data_files/server7_int-ca.crt \ |
| 9952 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9953 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9954 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9955 | 0 \ |
| 9956 | -s "fragmenting handshake message" |
| 9957 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9958 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9959 | requires_config_enabled MBEDTLS_RSA_C |
| 9960 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9961 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9962 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9963 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9964 | "$P_CLI dtls=1 debug_level=2 \ |
| 9965 | crt_file=data_files/server8_int-ca2.crt \ |
| 9966 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9967 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9968 | 0 \ |
| 9969 | -c "fragmenting handshake message" \ |
| 9970 | -C "error" |
| 9971 | |
| 9972 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9973 | requires_config_enabled MBEDTLS_RSA_C |
| 9974 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9975 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9976 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9977 | "$P_SRV dtls=1 debug_level=2 \ |
| 9978 | crt_file=data_files/server7_int-ca.crt \ |
| 9979 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9980 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9981 | "$O_CLI -dtls1_2" \ |
| 9982 | 0 \ |
| 9983 | -s "fragmenting handshake message" |
| 9984 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9985 | # interop tests for DTLS fragmentating with unreliable connection |
| 9986 | # |
| 9987 | # again we just want to test that the we fragment in a way that |
| 9988 | # pleases other implementations, so we don't need the peer to fragment |
| 9989 | requires_gnutls_next |
| 9990 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9991 | requires_config_enabled MBEDTLS_RSA_C |
| 9992 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9993 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9994 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9995 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9996 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9997 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9998 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9999 | crt_file=data_files/server8_int-ca2.crt \ |
| 10000 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10001 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10002 | 0 \ |
| 10003 | -c "fragmenting handshake message" \ |
| 10004 | -C "error" |
| 10005 | |
| 10006 | requires_gnutls_next |
| 10007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10008 | requires_config_enabled MBEDTLS_RSA_C |
| 10009 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10010 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10011 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10012 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10013 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10014 | "$P_SRV dtls=1 debug_level=2 \ |
| 10015 | crt_file=data_files/server7_int-ca.crt \ |
| 10016 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10017 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10018 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10019 | 0 \ |
| 10020 | -s "fragmenting handshake message" |
| 10021 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10022 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10023 | ## it might trigger a bug due to openssl server (https://github.com/openssl/openssl/issues/6902) |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10024 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10025 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10026 | requires_config_enabled MBEDTLS_RSA_C |
| 10027 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10028 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10029 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10030 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10031 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10032 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10033 | "$P_CLI dtls=1 debug_level=2 \ |
| 10034 | crt_file=data_files/server8_int-ca2.crt \ |
| 10035 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10036 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10037 | 0 \ |
| 10038 | -c "fragmenting handshake message" \ |
| 10039 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10040 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10041 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10042 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10043 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10044 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10045 | requires_config_enabled MBEDTLS_RSA_C |
| 10046 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10047 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10048 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10049 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10050 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10051 | "$P_SRV dtls=1 debug_level=2 \ |
| 10052 | crt_file=data_files/server7_int-ca.crt \ |
| 10053 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10054 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10055 | "$O_CLI -dtls1_2" \ |
| 10056 | 0 \ |
| 10057 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10058 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10059 | # Tests for DTLS-SRTP (RFC 5764) |
| 10060 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10062 | run_test "DTLS-SRTP all profiles supported" \ |
| 10063 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10064 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10065 | 0 \ |
| 10066 | -s "found use_srtp extension" \ |
| 10067 | -s "found srtp profile" \ |
| 10068 | -s "selected srtp profile" \ |
| 10069 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10070 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10071 | -c "client hello, adding use_srtp extension" \ |
| 10072 | -c "found use_srtp extension" \ |
| 10073 | -c "found srtp profile" \ |
| 10074 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10075 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10076 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10077 | -C "error" |
| 10078 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10079 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10080 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10081 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10082 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10083 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10084 | "$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] | 10085 | 0 \ |
| 10086 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10087 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10088 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10089 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10090 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10091 | -c "client hello, adding use_srtp extension" \ |
| 10092 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10093 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10094 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10095 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10096 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10097 | -C "error" |
| 10098 | |
| 10099 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10101 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10102 | "$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] | 10103 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10104 | 0 \ |
| 10105 | -s "found use_srtp extension" \ |
| 10106 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10107 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10108 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10109 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10110 | -c "client hello, adding use_srtp extension" \ |
| 10111 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10112 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10113 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10114 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10115 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10116 | -C "error" |
| 10117 | |
| 10118 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10120 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10121 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10122 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10123 | 0 \ |
| 10124 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10125 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10126 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10127 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10128 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10129 | -c "client hello, adding use_srtp extension" \ |
| 10130 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10131 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10132 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10133 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10134 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10135 | -C "error" |
| 10136 | |
| 10137 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10139 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10140 | "$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] | 10141 | "$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] | 10142 | 0 \ |
| 10143 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10144 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10145 | -S "selected srtp profile" \ |
| 10146 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10147 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10148 | -c "client hello, adding use_srtp extension" \ |
| 10149 | -C "found use_srtp extension" \ |
| 10150 | -C "found srtp profile" \ |
| 10151 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10152 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10153 | -C "error" |
| 10154 | |
| 10155 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10156 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10157 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10158 | "$P_SRV dtls=1 debug_level=3" \ |
| 10159 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10160 | 0 \ |
| 10161 | -s "found use_srtp extension" \ |
| 10162 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10163 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10164 | -c "client hello, adding use_srtp extension" \ |
| 10165 | -C "found use_srtp extension" \ |
| 10166 | -C "found srtp profile" \ |
| 10167 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10168 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10169 | -C "error" |
| 10170 | |
| 10171 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10173 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10174 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10175 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10176 | 0 \ |
| 10177 | -s "found use_srtp extension" \ |
| 10178 | -s "found srtp profile" \ |
| 10179 | -s "selected srtp profile" \ |
| 10180 | -s "server hello, adding use_srtp extension" \ |
| 10181 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10182 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10183 | -c "client hello, adding use_srtp extension" \ |
| 10184 | -c "found use_srtp extension" \ |
| 10185 | -c "found srtp profile" \ |
| 10186 | -c "selected srtp profile" \ |
| 10187 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10188 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10189 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10190 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10191 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10192 | -C "error" |
| 10193 | |
| 10194 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10195 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10196 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10197 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10198 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10199 | 0 \ |
| 10200 | -s "found use_srtp extension" \ |
| 10201 | -s "found srtp profile" \ |
| 10202 | -s "selected srtp profile" \ |
| 10203 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10204 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10205 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10206 | -S "dumping 'using mki' (8 bytes)" \ |
| 10207 | -c "client hello, adding use_srtp extension" \ |
| 10208 | -c "found use_srtp extension" \ |
| 10209 | -c "found srtp profile" \ |
| 10210 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10211 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10212 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10213 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10214 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10215 | -C "dumping 'received mki' (8 bytes)" \ |
| 10216 | -C "error" |
| 10217 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10218 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10220 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10221 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10222 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10223 | 0 \ |
| 10224 | -s "found use_srtp extension" \ |
| 10225 | -s "found srtp profile" \ |
| 10226 | -s "selected srtp profile" \ |
| 10227 | -s "server hello, adding use_srtp extension" \ |
| 10228 | -s "DTLS-SRTP key material is"\ |
| 10229 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10230 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10231 | |
| 10232 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10233 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10234 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10235 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10236 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10237 | 0 \ |
| 10238 | -s "found use_srtp extension" \ |
| 10239 | -s "found srtp profile" \ |
| 10240 | -s "selected srtp profile" \ |
| 10241 | -s "server hello, adding use_srtp extension" \ |
| 10242 | -s "DTLS-SRTP key material is"\ |
| 10243 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10244 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10245 | |
| 10246 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10248 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10249 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10250 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10251 | 0 \ |
| 10252 | -s "found use_srtp extension" \ |
| 10253 | -s "found srtp profile" \ |
| 10254 | -s "selected srtp profile" \ |
| 10255 | -s "server hello, adding use_srtp extension" \ |
| 10256 | -s "DTLS-SRTP key material is"\ |
| 10257 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10258 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10259 | |
| 10260 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10262 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10263 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10264 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10265 | 0 \ |
| 10266 | -s "found use_srtp extension" \ |
| 10267 | -s "found srtp profile" \ |
| 10268 | -s "selected srtp profile" \ |
| 10269 | -s "server hello, adding use_srtp extension" \ |
| 10270 | -s "DTLS-SRTP key material is"\ |
| 10271 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10272 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10273 | |
| 10274 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10276 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10277 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10278 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10279 | 0 \ |
| 10280 | -s "found use_srtp extension" \ |
| 10281 | -s "found srtp profile" \ |
| 10282 | -s "selected srtp profile" \ |
| 10283 | -s "server hello, adding use_srtp extension" \ |
| 10284 | -s "DTLS-SRTP key material is"\ |
| 10285 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10286 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10287 | |
| 10288 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10289 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10290 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10291 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10292 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10293 | 0 \ |
| 10294 | -s "found use_srtp extension" \ |
| 10295 | -s "found srtp profile" \ |
| 10296 | -S "selected srtp profile" \ |
| 10297 | -S "server hello, adding use_srtp extension" \ |
| 10298 | -S "DTLS-SRTP key material is"\ |
| 10299 | -C "SRTP Extension negotiated, profile" |
| 10300 | |
| 10301 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10303 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10304 | "$P_SRV dtls=1 debug_level=3" \ |
| 10305 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10306 | 0 \ |
| 10307 | -s "found use_srtp extension" \ |
| 10308 | -S "server hello, adding use_srtp extension" \ |
| 10309 | -S "DTLS-SRTP key material is"\ |
| 10310 | -C "SRTP Extension negotiated, profile" |
| 10311 | |
| 10312 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10314 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10315 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10316 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10317 | 0 \ |
| 10318 | -c "client hello, adding use_srtp extension" \ |
| 10319 | -c "found use_srtp extension" \ |
| 10320 | -c "found srtp profile" \ |
| 10321 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10322 | -c "DTLS-SRTP key material is"\ |
| 10323 | -C "error" |
| 10324 | |
| 10325 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10327 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10328 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10329 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10330 | 0 \ |
| 10331 | -c "client hello, adding use_srtp extension" \ |
| 10332 | -c "found use_srtp extension" \ |
| 10333 | -c "found srtp profile" \ |
| 10334 | -c "selected srtp profile" \ |
| 10335 | -c "DTLS-SRTP key material is"\ |
| 10336 | -C "error" |
| 10337 | |
| 10338 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10340 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10341 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10342 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10343 | 0 \ |
| 10344 | -c "client hello, adding use_srtp extension" \ |
| 10345 | -c "found use_srtp extension" \ |
| 10346 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10347 | -c "selected srtp profile" \ |
| 10348 | -c "DTLS-SRTP key material is"\ |
| 10349 | -C "error" |
| 10350 | |
| 10351 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10353 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10354 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10355 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10356 | 0 \ |
| 10357 | -c "client hello, adding use_srtp extension" \ |
| 10358 | -c "found use_srtp extension" \ |
| 10359 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10360 | -c "selected srtp profile" \ |
| 10361 | -c "DTLS-SRTP key material is"\ |
| 10362 | -C "error" |
| 10363 | |
| 10364 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10366 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10367 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10368 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10369 | 0 \ |
| 10370 | -c "client hello, adding use_srtp extension" \ |
| 10371 | -c "found use_srtp extension" \ |
| 10372 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10373 | -c "selected srtp profile" \ |
| 10374 | -c "DTLS-SRTP key material is"\ |
| 10375 | -C "error" |
| 10376 | |
| 10377 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10379 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10380 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10381 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10382 | 0 \ |
| 10383 | -c "client hello, adding use_srtp extension" \ |
| 10384 | -C "found use_srtp extension" \ |
| 10385 | -C "found srtp profile" \ |
| 10386 | -C "selected srtp profile" \ |
| 10387 | -C "DTLS-SRTP key material is"\ |
| 10388 | -C "error" |
| 10389 | |
| 10390 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10392 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10393 | "$O_SRV -dtls" \ |
| 10394 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10395 | 0 \ |
| 10396 | -c "client hello, adding use_srtp extension" \ |
| 10397 | -C "found use_srtp extension" \ |
| 10398 | -C "found srtp profile" \ |
| 10399 | -C "selected srtp profile" \ |
| 10400 | -C "DTLS-SRTP key material is"\ |
| 10401 | -C "error" |
| 10402 | |
| 10403 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10405 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10406 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10407 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10408 | 0 \ |
| 10409 | -c "client hello, adding use_srtp extension" \ |
| 10410 | -c "found use_srtp extension" \ |
| 10411 | -c "found srtp profile" \ |
| 10412 | -c "selected srtp profile" \ |
| 10413 | -c "DTLS-SRTP key material is"\ |
| 10414 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10415 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10416 | -C "dumping 'received mki' (8 bytes)" \ |
| 10417 | -C "error" |
| 10418 | |
| 10419 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10420 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10421 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10422 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10423 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10424 | "$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] | 10425 | 0 \ |
| 10426 | -s "found use_srtp extension" \ |
| 10427 | -s "found srtp profile" \ |
| 10428 | -s "selected srtp profile" \ |
| 10429 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10430 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10431 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10432 | |
| 10433 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10434 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10436 | 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] | 10437 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10438 | "$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] | 10439 | 0 \ |
| 10440 | -s "found use_srtp extension" \ |
| 10441 | -s "found srtp profile" \ |
| 10442 | -s "selected srtp profile" \ |
| 10443 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10444 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10445 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10446 | |
| 10447 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10448 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10450 | 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] | 10451 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10452 | "$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] | 10453 | 0 \ |
| 10454 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10455 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10456 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10457 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10458 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10459 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10460 | |
| 10461 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10462 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10463 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10464 | 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] | 10465 | "$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] | 10466 | "$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] | 10467 | 0 \ |
| 10468 | -s "found use_srtp extension" \ |
| 10469 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10470 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10471 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10472 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10473 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10474 | |
| 10475 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10476 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10477 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10478 | 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] | 10479 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10480 | "$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] | 10481 | 0 \ |
| 10482 | -s "found use_srtp extension" \ |
| 10483 | -s "found srtp profile" \ |
| 10484 | -s "selected srtp profile" \ |
| 10485 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10486 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10487 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10488 | |
| 10489 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10490 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10492 | 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] | 10493 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10494 | "$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] | 10495 | 0 \ |
| 10496 | -s "found use_srtp extension" \ |
| 10497 | -s "found srtp profile" \ |
| 10498 | -S "selected srtp profile" \ |
| 10499 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10500 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10501 | -C "SRTP profile:" |
| 10502 | |
| 10503 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10504 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10505 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10506 | 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] | 10507 | "$P_SRV dtls=1 debug_level=3" \ |
| 10508 | "$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] | 10509 | 0 \ |
| 10510 | -s "found use_srtp extension" \ |
| 10511 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10512 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10513 | -C "SRTP profile:" |
| 10514 | |
| 10515 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10516 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10517 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10518 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10519 | "$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" \ |
| 10520 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10521 | 0 \ |
| 10522 | -c "client hello, adding use_srtp extension" \ |
| 10523 | -c "found use_srtp extension" \ |
| 10524 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10525 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10526 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10527 | -C "error" |
| 10528 | |
| 10529 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10530 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10532 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10533 | "$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" \ |
| 10534 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10535 | 0 \ |
| 10536 | -c "client hello, adding use_srtp extension" \ |
| 10537 | -c "found use_srtp extension" \ |
| 10538 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10539 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10540 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10541 | -C "error" |
| 10542 | |
| 10543 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10544 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10545 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10546 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10547 | "$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" \ |
| 10548 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10549 | 0 \ |
| 10550 | -c "client hello, adding use_srtp extension" \ |
| 10551 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10552 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10553 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10554 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10555 | -C "error" |
| 10556 | |
| 10557 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10558 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10560 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10561 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10562 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10563 | 0 \ |
| 10564 | -c "client hello, adding use_srtp extension" \ |
| 10565 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10566 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10567 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10568 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10569 | -C "error" |
| 10570 | |
| 10571 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10572 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10574 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10575 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10576 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10577 | 0 \ |
| 10578 | -c "client hello, adding use_srtp extension" \ |
| 10579 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10580 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10581 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10582 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10583 | -C "error" |
| 10584 | |
| 10585 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10586 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10587 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10588 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10589 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10590 | "$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] | 10591 | 0 \ |
| 10592 | -c "client hello, adding use_srtp extension" \ |
| 10593 | -C "found use_srtp extension" \ |
| 10594 | -C "found srtp profile" \ |
| 10595 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10596 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10597 | -C "error" |
| 10598 | |
| 10599 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10600 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10602 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10603 | "$G_SRV -u" \ |
| 10604 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10605 | 0 \ |
| 10606 | -c "client hello, adding use_srtp extension" \ |
| 10607 | -C "found use_srtp extension" \ |
| 10608 | -C "found srtp profile" \ |
| 10609 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10610 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10611 | -C "error" |
| 10612 | |
| 10613 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10614 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10615 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10616 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10617 | "$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" \ |
| 10618 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10619 | 0 \ |
| 10620 | -c "client hello, adding use_srtp extension" \ |
| 10621 | -c "found use_srtp extension" \ |
| 10622 | -c "found srtp profile" \ |
| 10623 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10624 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10625 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10626 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10627 | -c "dumping 'received mki' (8 bytes)" \ |
| 10628 | -C "error" |
| 10629 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10630 | # Tests for specific things with "unreliable" UDP connection |
| 10631 | |
| 10632 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10633 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10634 | run_test "DTLS proxy: reference" \ |
| 10635 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10636 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10637 | "$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] | 10638 | 0 \ |
| 10639 | -C "replayed record" \ |
| 10640 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10641 | -C "Buffer record from epoch" \ |
| 10642 | -S "Buffer record from epoch" \ |
| 10643 | -C "ssl_buffer_message" \ |
| 10644 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10645 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10646 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10647 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10648 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10649 | -c "HTTP/1.0 200 OK" |
| 10650 | |
| 10651 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10652 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10653 | run_test "DTLS proxy: duplicate every packet" \ |
| 10654 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10655 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10656 | "$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] | 10657 | 0 \ |
| 10658 | -c "replayed record" \ |
| 10659 | -s "replayed record" \ |
| 10660 | -c "record from another epoch" \ |
| 10661 | -s "record from another epoch" \ |
| 10662 | -S "resend" \ |
| 10663 | -s "Extra-header:" \ |
| 10664 | -c "HTTP/1.0 200 OK" |
| 10665 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10667 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10668 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10669 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10670 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10671 | 0 \ |
| 10672 | -c "replayed record" \ |
| 10673 | -S "replayed record" \ |
| 10674 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10675 | -s "record from another epoch" \ |
| 10676 | -c "resend" \ |
| 10677 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10678 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10679 | -c "HTTP/1.0 200 OK" |
| 10680 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10682 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10683 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10684 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10685 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10686 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10687 | -c "next record in same datagram" \ |
| 10688 | -s "next record in same datagram" |
| 10689 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10690 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10691 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10692 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10693 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10694 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10695 | 0 \ |
| 10696 | -c "next record in same datagram" \ |
| 10697 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10698 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10699 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10700 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10701 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10702 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10703 | "$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] | 10704 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10705 | -c "discarding invalid record (mac)" \ |
| 10706 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10707 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10708 | -c "HTTP/1.0 200 OK" \ |
| 10709 | -S "too many records with bad MAC" \ |
| 10710 | -S "Verification of the message MAC failed" |
| 10711 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10712 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10713 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10714 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10715 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10716 | "$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] | 10717 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10718 | -C "discarding invalid record (mac)" \ |
| 10719 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10720 | -S "Extra-header:" \ |
| 10721 | -C "HTTP/1.0 200 OK" \ |
| 10722 | -s "too many records with bad MAC" \ |
| 10723 | -s "Verification of the message MAC failed" |
| 10724 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10726 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10727 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10728 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10729 | "$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] | 10730 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10731 | -c "discarding invalid record (mac)" \ |
| 10732 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10733 | -s "Extra-header:" \ |
| 10734 | -c "HTTP/1.0 200 OK" \ |
| 10735 | -S "too many records with bad MAC" \ |
| 10736 | -S "Verification of the message MAC failed" |
| 10737 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10738 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10739 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10740 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10741 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10742 | "$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] | 10743 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10744 | -c "discarding invalid record (mac)" \ |
| 10745 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10746 | -s "Extra-header:" \ |
| 10747 | -c "HTTP/1.0 200 OK" \ |
| 10748 | -s "too many records with bad MAC" \ |
| 10749 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10752 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10753 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10754 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10755 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10756 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10757 | -c "record from another epoch" \ |
| 10758 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10759 | -s "Extra-header:" \ |
| 10760 | -c "HTTP/1.0 200 OK" |
| 10761 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10762 | # Tests for reordering support with DTLS |
| 10763 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10764 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10766 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10767 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10768 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10769 | hs_timeout=2500-60000" \ |
| 10770 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10771 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10772 | 0 \ |
| 10773 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10774 | -c "Next handshake message has been buffered - load"\ |
| 10775 | -S "Buffering HS message" \ |
| 10776 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10777 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10778 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10779 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10780 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10781 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10782 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10784 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10785 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10786 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10787 | hs_timeout=2500-60000" \ |
| 10788 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10789 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10790 | 0 \ |
| 10791 | -c "Buffering HS message" \ |
| 10792 | -c "found fragmented DTLS handshake message"\ |
| 10793 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10794 | -c "Next handshake message has been buffered - load"\ |
| 10795 | -S "Buffering HS message" \ |
| 10796 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10797 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10798 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10799 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10800 | -S "Remember CCS message" |
| 10801 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10802 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10803 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10804 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10805 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10806 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10807 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10809 | 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] | 10810 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10811 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10812 | hs_timeout=2500-60000" \ |
| 10813 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10814 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10815 | 0 \ |
| 10816 | -c "Buffering HS message" \ |
| 10817 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10818 | -C "attempt to make space by freeing buffered messages" \ |
| 10819 | -S "Buffering HS message" \ |
| 10820 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10821 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10822 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10823 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10824 | -S "Remember CCS message" |
| 10825 | |
| 10826 | # The size constraints ensure that the delayed certificate message can't |
| 10827 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10828 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10829 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10830 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10831 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10833 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10834 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10835 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10836 | hs_timeout=2500-60000" \ |
| 10837 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10838 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10839 | 0 \ |
| 10840 | -c "Buffering HS message" \ |
| 10841 | -c "attempt to make space by freeing buffered future messages" \ |
| 10842 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10843 | -S "Buffering HS message" \ |
| 10844 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10845 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10846 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10847 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10848 | -S "Remember CCS message" |
| 10849 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10850 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10852 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10853 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10854 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10855 | hs_timeout=2500-60000" \ |
| 10856 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10857 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10858 | 0 \ |
| 10859 | -C "Buffering HS message" \ |
| 10860 | -C "Next handshake message has been buffered - load"\ |
| 10861 | -s "Buffering HS message" \ |
| 10862 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10863 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10864 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10865 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10866 | -S "Remember CCS message" |
| 10867 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10868 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10870 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10871 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10872 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10873 | hs_timeout=2500-60000" \ |
| 10874 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10875 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10876 | 0 \ |
| 10877 | -C "Buffering HS message" \ |
| 10878 | -C "Next handshake message has been buffered - load"\ |
| 10879 | -S "Buffering HS message" \ |
| 10880 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10881 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10882 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10883 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10884 | -S "Remember CCS message" |
| 10885 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10886 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10888 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10889 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10890 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10891 | hs_timeout=2500-60000" \ |
| 10892 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10893 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10894 | 0 \ |
| 10895 | -C "Buffering HS message" \ |
| 10896 | -C "Next handshake message has been buffered - load"\ |
| 10897 | -S "Buffering HS message" \ |
| 10898 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10899 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10900 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10901 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10902 | -s "Remember CCS message" |
| 10903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10905 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10906 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10907 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10908 | hs_timeout=2500-60000" \ |
| 10909 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10910 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10911 | 0 \ |
| 10912 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10913 | -s "Found buffered record from current epoch - load" \ |
| 10914 | -c "Buffer record from epoch 1" \ |
| 10915 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10916 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10917 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10918 | # from the server are delayed, so that the encrypted Finished message |
| 10919 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10920 | # in afterwards, the encrypted Finished message must be freed in order |
| 10921 | # to make space for the NewSessionTicket to be reassembled. |
| 10922 | # This works only in very particular circumstances: |
| 10923 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10924 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10925 | # the encrypted Finished message. |
| 10926 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10927 | # needs to be fragmented. |
| 10928 | # - All messages sent by the server must be small enough to be either sent |
| 10929 | # without fragmentation or be reassembled within the bounds of |
| 10930 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10931 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10932 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10933 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10935 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10936 | -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] | 10937 | "$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] | 10938 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10939 | 0 \ |
| 10940 | -s "Buffer record from epoch 1" \ |
| 10941 | -s "Found buffered record from current epoch - load" \ |
| 10942 | -c "Buffer record from epoch 1" \ |
| 10943 | -C "Found buffered record from current epoch - load" \ |
| 10944 | -c "Enough space available after freeing future epoch record" |
| 10945 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10946 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10947 | |
| 10948 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10949 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10950 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10951 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10952 | "$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] | 10953 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10954 | "$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] | 10955 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10956 | 0 \ |
| 10957 | -s "Extra-header:" \ |
| 10958 | -c "HTTP/1.0 200 OK" |
| 10959 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10960 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10961 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10962 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10963 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10964 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10965 | "$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] | 10966 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10967 | 0 \ |
| 10968 | -s "Extra-header:" \ |
| 10969 | -c "HTTP/1.0 200 OK" |
| 10970 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10971 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10973 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10974 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10975 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10976 | "$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] | 10977 | 0 \ |
| 10978 | -s "Extra-header:" \ |
| 10979 | -c "HTTP/1.0 200 OK" |
| 10980 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10981 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10983 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10984 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10985 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10986 | "$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] | 10987 | 0 \ |
| 10988 | -s "Extra-header:" \ |
| 10989 | -c "HTTP/1.0 200 OK" |
| 10990 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10991 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10993 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10994 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10995 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10996 | "$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] | 10997 | 0 \ |
| 10998 | -s "Extra-header:" \ |
| 10999 | -c "HTTP/1.0 200 OK" |
| 11000 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11001 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11002 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11003 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11004 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11005 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11006 | "$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] | 11007 | 0 \ |
| 11008 | -s "Extra-header:" \ |
| 11009 | -c "HTTP/1.0 200 OK" |
| 11010 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11011 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11012 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11013 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11014 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11015 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11016 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11017 | "$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] | 11018 | 0 \ |
| 11019 | -s "Extra-header:" \ |
| 11020 | -c "HTTP/1.0 200 OK" |
| 11021 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11022 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11023 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11024 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11025 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11026 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11027 | "$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] | 11028 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11029 | "$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] | 11030 | 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] | 11031 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11032 | 0 \ |
| 11033 | -s "a session has been resumed" \ |
| 11034 | -c "a session has been resumed" \ |
| 11035 | -s "Extra-header:" \ |
| 11036 | -c "HTTP/1.0 200 OK" |
| 11037 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11038 | client_needs_more_time 4 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11039 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11040 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11041 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11042 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11043 | "$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] | 11044 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11045 | "$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] | 11046 | 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] | 11047 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11048 | 0 \ |
| 11049 | -s "a session has been resumed" \ |
| 11050 | -c "a session has been resumed" \ |
| 11051 | -s "Extra-header:" \ |
| 11052 | -c "HTTP/1.0 200 OK" |
| 11053 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11054 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11055 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11056 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11057 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11058 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11059 | "$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] | 11060 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11061 | "$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] | 11062 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11063 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11064 | 0 \ |
| 11065 | -c "=> renegotiate" \ |
| 11066 | -s "=> renegotiate" \ |
| 11067 | -s "Extra-header:" \ |
| 11068 | -c "HTTP/1.0 200 OK" |
| 11069 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11070 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11072 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11073 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11074 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11075 | "$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] | 11076 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11077 | "$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] | 11078 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11079 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11080 | 0 \ |
| 11081 | -c "=> renegotiate" \ |
| 11082 | -s "=> renegotiate" \ |
| 11083 | -s "Extra-header:" \ |
| 11084 | -c "HTTP/1.0 200 OK" |
| 11085 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11086 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11087 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11089 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11090 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11091 | "$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] | 11092 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11093 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11094 | "$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] | 11095 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11096 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11097 | 0 \ |
| 11098 | -c "=> renegotiate" \ |
| 11099 | -s "=> renegotiate" \ |
| 11100 | -s "Extra-header:" \ |
| 11101 | -c "HTTP/1.0 200 OK" |
| 11102 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11103 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11104 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11105 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11106 | 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] | 11107 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11108 | "$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] | 11109 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11110 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11111 | "$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] | 11112 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11113 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11114 | 0 \ |
| 11115 | -c "=> renegotiate" \ |
| 11116 | -s "=> renegotiate" \ |
| 11117 | -s "Extra-header:" \ |
| 11118 | -c "HTTP/1.0 200 OK" |
| 11119 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11120 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11121 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11122 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11123 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11124 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11125 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11127 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11128 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11129 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11130 | "$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] | 11131 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11132 | -c "HTTP/1.0 200 OK" |
| 11133 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11134 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11135 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11136 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11137 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11138 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11139 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11140 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11141 | "$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] | 11142 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11143 | -c "HTTP/1.0 200 OK" |
| 11144 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11145 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11146 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11147 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11148 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11149 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11150 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11151 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11152 | "$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] | 11153 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11154 | -c "HTTP/1.0 200 OK" |
| 11155 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11156 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11157 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11158 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11160 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11161 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11162 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11163 | "$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] | 11164 | 0 \ |
| 11165 | -s "Extra-header:" \ |
| 11166 | -c "Extra-header:" |
| 11167 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11168 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11169 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11170 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11172 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11173 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11174 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11175 | "$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] | 11176 | 0 \ |
| 11177 | -s "Extra-header:" \ |
| 11178 | -c "Extra-header:" |
| 11179 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11180 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11181 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11182 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11183 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11184 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11185 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11186 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11187 | "$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] | 11188 | 0 \ |
| 11189 | -s "Extra-header:" \ |
| 11190 | -c "Extra-header:" |
| 11191 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11193 | run_test "export keys functionality" \ |
| 11194 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 11195 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 11196 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11197 | -c "EAP-TLS key material is:"\ |
| 11198 | -s "EAP-TLS key material is:"\ |
| 11199 | -c "EAP-TLS IV is:" \ |
| 11200 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11201 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11202 | # openssl feature tests: check if tls1.3 exists. |
| 11203 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11204 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11205 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11206 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11207 | 0 \ |
| 11208 | -c "TLS 1.3" \ |
| 11209 | -s "TLS 1.3" |
| 11210 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11211 | # 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] | 11212 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11213 | requires_gnutls_next_no_ticket |
| 11214 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11215 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11216 | "$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] | 11217 | "$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] | 11218 | 0 \ |
| 11219 | -s "Version: TLS1.3" \ |
| 11220 | -c "Version: TLS1.3" |
| 11221 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11222 | # TLS1.3 test cases |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11223 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11224 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11225 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11226 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11227 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11228 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11229 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11230 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11231 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11232 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11233 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11234 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11235 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11236 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11237 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11238 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11239 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11240 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11241 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11242 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11243 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11244 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11245 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11246 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11247 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11248 | -c "=> parse certificate verify" \ |
| 11249 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11250 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11251 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11252 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11253 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11254 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11255 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11256 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11257 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11258 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11259 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11260 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11261 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11262 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11263 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11264 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11265 | -s "SERVER HELLO was queued" \ |
| 11266 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11267 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11268 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11269 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11270 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11271 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11272 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11273 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11274 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11275 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11276 | -c "<= ssl_tls13_process_server_hello" \ |
Jerry Yu | 745bb61 | 2021-10-13 22:01:04 +0800 | [diff] [blame] | 11277 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11278 | -c "ECDH curve: x25519" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11279 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11280 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11281 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11282 | -c "=> parse certificate verify" \ |
| 11283 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11284 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11285 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11286 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11287 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11288 | |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11289 | requires_openssl_tls1_3 |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11290 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11291 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11292 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11293 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11294 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11295 | run_test "TLS 1.3: alpn - openssl" \ |
| 11296 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11297 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11298 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11299 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11300 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11301 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11302 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11303 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11304 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11305 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11306 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11307 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11308 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11309 | -c "<= ssl_tls13_process_server_hello" \ |
| 11310 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11311 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11312 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11313 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11314 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11315 | -c "=> parse certificate verify" \ |
| 11316 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11317 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11318 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11319 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11320 | -c "HTTP/1.0 200 ok" \ |
| 11321 | -c "Application Layer Protocol is h2" |
| 11322 | |
| 11323 | requires_gnutls_tls1_3 |
| 11324 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11325 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11326 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11327 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11328 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11329 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11330 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11331 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert --alpn=h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11332 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11333 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11334 | -s "SERVER HELLO was queued" \ |
| 11335 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11336 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11337 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11338 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11339 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11340 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11341 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11342 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11343 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11344 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11345 | -c "<= ssl_tls13_process_server_hello" \ |
| 11346 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11347 | -c "ECDH curve: x25519" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11348 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11349 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11350 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11351 | -c "=> parse certificate verify" \ |
| 11352 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11353 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11354 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11355 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11356 | -c "HTTP/1.0 200 OK" \ |
| 11357 | -c "Application Layer Protocol is h2" |
| 11358 | |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11359 | requires_openssl_tls1_3 |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11360 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11361 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11362 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11363 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11364 | run_test "TLS 1.3: server alpn - openssl" \ |
| 11365 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11366 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11367 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11368 | -s "found alpn extension" \ |
| 11369 | -s "server side, adding alpn extension" \ |
| 11370 | -s "Protocol is TLSv1.3" \ |
| 11371 | -s "HTTP/1.0 200 OK" \ |
| 11372 | -s "Application Layer Protocol is h2" |
| 11373 | |
| 11374 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11375 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11376 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11377 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11378 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11379 | run_test "TLS 1.3: server alpn - gnutls" \ |
| 11380 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 alpn=h2" \ |
| 11381 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11382 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11383 | -s "found alpn extension" \ |
| 11384 | -s "server side, adding alpn extension" \ |
| 11385 | -s "Protocol is TLSv1.3" \ |
| 11386 | -s "HTTP/1.0 200 OK" \ |
| 11387 | -s "Application Layer Protocol is h2" |
| 11388 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11389 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11390 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11391 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11392 | skip_handshake_stage_check |
| 11393 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11394 | 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] | 11395 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11396 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11397 | 1 \ |
| 11398 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11399 | -S "Version: TLS1.0" \ |
| 11400 | -C "Protocol is TLSv1.0" |
| 11401 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11402 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11403 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11404 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11405 | skip_handshake_stage_check |
| 11406 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11407 | 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] | 11408 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11409 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11410 | 1 \ |
| 11411 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11412 | -S "Version: TLS1.1" \ |
| 11413 | -C "Protocol is TLSv1.1" |
| 11414 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11416 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11417 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11418 | skip_handshake_stage_check |
| 11419 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11420 | 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] | 11421 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11422 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11423 | 1 \ |
| 11424 | -s "Client's version: 3.3" \ |
| 11425 | -c "is a fatal alert message (msg 40)" \ |
| 11426 | -S "Version: TLS1.2" \ |
| 11427 | -C "Protocol is TLSv1.2" |
| 11428 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11430 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11431 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11432 | skip_handshake_stage_check |
| 11433 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11434 | 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] | 11435 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11436 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11437 | 1 \ |
| 11438 | -s "fatal protocol_version" \ |
| 11439 | -c "is a fatal alert message (msg 70)" \ |
| 11440 | -S "Version: TLS1.0" \ |
| 11441 | -C "Protocol : TLSv1.0" |
| 11442 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11444 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11445 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11446 | skip_handshake_stage_check |
| 11447 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11448 | 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] | 11449 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11450 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11451 | 1 \ |
| 11452 | -s "fatal protocol_version" \ |
| 11453 | -c "is a fatal alert message (msg 70)" \ |
| 11454 | -S "Version: TLS1.1" \ |
| 11455 | -C "Protocol : TLSv1.1" |
| 11456 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11458 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11459 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11460 | skip_handshake_stage_check |
| 11461 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11462 | 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] | 11463 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11464 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11465 | 1 \ |
| 11466 | -s "fatal protocol_version" \ |
| 11467 | -c "is a fatal alert message (msg 70)" \ |
| 11468 | -S "Version: TLS1.2" \ |
| 11469 | -C "Protocol : TLSv1.2" |
| 11470 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11471 | requires_openssl_tls1_3 |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11472 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11473 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11474 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11475 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11476 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11477 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11478 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11479 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11480 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11481 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11482 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11483 | -c "HTTP/1.0 200 ok" \ |
| 11484 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11485 | |
| 11486 | requires_gnutls_tls1_3 |
| 11487 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11488 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11490 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11491 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11492 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11493 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11494 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11495 | 0 \ |
| 11496 | -c "got a certificate request" \ |
| 11497 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11498 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11499 | -c "HTTP/1.0 200 OK" \ |
| 11500 | -c "Protocol is TLSv1.3" |
| 11501 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11502 | |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11503 | requires_openssl_tls1_3 |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11505 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11506 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11507 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11508 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11509 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11510 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11511 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11512 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11513 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11514 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11515 | |
| 11516 | requires_gnutls_tls1_3 |
| 11517 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11518 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11519 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11520 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11521 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11522 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11523 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11524 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11525 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11526 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11527 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11528 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11529 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11530 | |
| 11531 | requires_openssl_tls1_3 |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11532 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11533 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11534 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11535 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11536 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11537 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11538 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11539 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11540 | 0 \ |
| 11541 | -c "got a certificate request" \ |
| 11542 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11543 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11544 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11545 | |
| 11546 | requires_gnutls_tls1_3 |
| 11547 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11548 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11549 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11550 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11551 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11552 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11553 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11554 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11555 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11556 | 0 \ |
| 11557 | -c "got a certificate request" \ |
| 11558 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11559 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11560 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11561 | |
| 11562 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11563 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11564 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11565 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11566 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11567 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11568 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11569 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11570 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11571 | 0 \ |
| 11572 | -c "got a certificate request" \ |
| 11573 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11574 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11575 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11576 | |
| 11577 | requires_gnutls_tls1_3 |
| 11578 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11579 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11580 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11581 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11582 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11583 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11584 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11585 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11586 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11587 | 0 \ |
| 11588 | -c "got a certificate request" \ |
| 11589 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11590 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11591 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11592 | |
| 11593 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11594 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11595 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11596 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11597 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11598 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11599 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11600 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11601 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11602 | 0 \ |
| 11603 | -c "got a certificate request" \ |
| 11604 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11605 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11606 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11607 | |
| 11608 | requires_gnutls_tls1_3 |
| 11609 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11610 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11611 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11612 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11613 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11614 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11615 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11616 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11617 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11618 | 0 \ |
| 11619 | -c "got a certificate request" \ |
| 11620 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11621 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11622 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11623 | |
| 11624 | requires_openssl_tls1_3 |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11625 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11626 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11627 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11628 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11629 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11630 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11631 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11632 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11633 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11634 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11635 | -c "got a certificate request" \ |
| 11636 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11637 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11638 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11639 | |
| 11640 | requires_gnutls_tls1_3 |
| 11641 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11642 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11643 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11644 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11645 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11646 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11647 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11648 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11649 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11650 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11651 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11652 | -c "got a certificate request" \ |
| 11653 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11654 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11655 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11656 | |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11657 | requires_openssl_tls1_3 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11658 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11659 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11660 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11661 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11662 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11663 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11664 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11665 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11666 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11667 | 0 \ |
| 11668 | -c "got a certificate request" \ |
| 11669 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11670 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11671 | -c "Protocol is TLSv1.3" |
| 11672 | |
| 11673 | requires_gnutls_tls1_3 |
| 11674 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11675 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11676 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11677 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11678 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11679 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11680 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11681 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11682 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11683 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11684 | 0 \ |
| 11685 | -c "got a certificate request" \ |
| 11686 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11687 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11688 | -c "Protocol is TLSv1.3" |
| 11689 | |
| 11690 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11691 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11692 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11693 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11694 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11695 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11696 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11697 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11698 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11699 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11700 | 0 \ |
| 11701 | -c "got a certificate request" \ |
| 11702 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11703 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11704 | -c "Protocol is TLSv1.3" |
| 11705 | |
| 11706 | requires_gnutls_tls1_3 |
| 11707 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11709 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11710 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11711 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11712 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11713 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11714 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11715 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11716 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11717 | 0 \ |
| 11718 | -c "got a certificate request" \ |
| 11719 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11720 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11721 | -c "Protocol is TLSv1.3" |
| 11722 | |
| 11723 | requires_openssl_tls1_3 |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11724 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11725 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11726 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11727 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11728 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11729 | 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] | 11730 | "$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] | 11731 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11732 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11733 | 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] | 11734 | 1 \ |
| 11735 | -c "got a certificate request" \ |
| 11736 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11737 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11738 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11739 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11740 | |
| 11741 | requires_gnutls_tls1_3 |
| 11742 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11743 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11744 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11745 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11746 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11747 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11748 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11749 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11750 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11751 | 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] | 11752 | 1 \ |
| 11753 | -c "got a certificate request" \ |
| 11754 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11755 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 11756 | -c "no suitable signature algorithm" \ |
Andrzej Kurek | 5c65c57 | 2022-04-13 14:28:52 -0400 | [diff] [blame] | 11757 | -C "unknown pk type" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11758 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11759 | # Test using an opaque private key for client authentication |
| 11760 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11761 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11762 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11763 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11764 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11765 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11766 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11767 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11768 | 0 \ |
| 11769 | -c "got a certificate request" \ |
| 11770 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11771 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11772 | -c "Protocol is TLSv1.3" |
| 11773 | |
| 11774 | requires_gnutls_tls1_3 |
| 11775 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11776 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11777 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11778 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11779 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11780 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11781 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11782 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11783 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11784 | 0 \ |
| 11785 | -c "got a certificate request" \ |
| 11786 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11787 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11788 | -c "Protocol is TLSv1.3" |
| 11789 | |
| 11790 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11791 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11792 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11793 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11794 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11795 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11796 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11797 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11798 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11799 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11800 | 0 \ |
| 11801 | -c "got a certificate request" \ |
| 11802 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11803 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11804 | -c "Protocol is TLSv1.3" |
| 11805 | |
| 11806 | requires_gnutls_tls1_3 |
| 11807 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11808 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11809 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11810 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11811 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11812 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11813 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11814 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11815 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11816 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11817 | 0 \ |
| 11818 | -c "got a certificate request" \ |
| 11819 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11820 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11821 | -c "Protocol is TLSv1.3" |
| 11822 | |
| 11823 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11824 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11825 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11826 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11827 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11828 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11829 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11830 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11831 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11832 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11833 | 0 \ |
| 11834 | -c "got a certificate request" \ |
| 11835 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11836 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11837 | -c "Protocol is TLSv1.3" |
| 11838 | |
| 11839 | requires_gnutls_tls1_3 |
| 11840 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11841 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11842 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11843 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11844 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11845 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11846 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11847 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11848 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11849 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11850 | 0 \ |
| 11851 | -c "got a certificate request" \ |
| 11852 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11853 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11854 | -c "Protocol is TLSv1.3" |
| 11855 | |
| 11856 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11857 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11858 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11859 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11860 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11861 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11862 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11863 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11864 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11865 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11866 | 0 \ |
| 11867 | -c "got a certificate request" \ |
| 11868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11869 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11870 | -c "Protocol is TLSv1.3" |
| 11871 | |
| 11872 | requires_gnutls_tls1_3 |
| 11873 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11874 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11875 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11876 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11877 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11878 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11879 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11880 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11881 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11882 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11883 | 0 \ |
| 11884 | -c "got a certificate request" \ |
| 11885 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11886 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11887 | -c "Protocol is TLSv1.3" |
| 11888 | |
| 11889 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11890 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11891 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11892 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11893 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11894 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11895 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11896 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 11897 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11898 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 11899 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11900 | 0 \ |
| 11901 | -c "got a certificate request" \ |
| 11902 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11903 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11904 | -c "Protocol is TLSv1.3" |
| 11905 | |
| 11906 | requires_gnutls_tls1_3 |
| 11907 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11908 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11909 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11910 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11911 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11912 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11913 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11914 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 11915 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11916 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 11917 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 11918 | 0 \ |
| 11919 | -c "got a certificate request" \ |
| 11920 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11921 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11922 | -c "Protocol is TLSv1.3" |
| 11923 | |
| 11924 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11925 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11926 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11927 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11928 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11929 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11930 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11931 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 11932 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11933 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11934 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11935 | 0 \ |
| 11936 | -c "got a certificate request" \ |
| 11937 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11938 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11939 | -c "Protocol is TLSv1.3" |
| 11940 | |
| 11941 | requires_gnutls_tls1_3 |
| 11942 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11943 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11944 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11945 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11946 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11947 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11948 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11949 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 11950 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11951 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11952 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 11953 | 0 \ |
| 11954 | -c "got a certificate request" \ |
| 11955 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11956 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11957 | -c "Protocol is TLSv1.3" |
| 11958 | |
| 11959 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11960 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11961 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11962 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11963 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11964 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11965 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11966 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 11967 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11968 | "$P_CLI debug_level=4 force_version=tls13 crt_file=data_files/cert_sha256.crt \ |
| 11969 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11970 | 0 \ |
| 11971 | -c "got a certificate request" \ |
| 11972 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11973 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11974 | -c "Protocol is TLSv1.3" |
| 11975 | |
| 11976 | requires_gnutls_tls1_3 |
| 11977 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11978 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11979 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11980 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11981 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11982 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11983 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11984 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 11985 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11986 | "$P_CLI debug_level=3 force_version=tls13 crt_file=data_files/server2-sha256.crt \ |
| 11987 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 11988 | 0 \ |
| 11989 | -c "got a certificate request" \ |
| 11990 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11991 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11992 | -c "Protocol is TLSv1.3" |
| 11993 | |
| 11994 | requires_openssl_tls1_3 |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11995 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11996 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11997 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11998 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11999 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12000 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12001 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12002 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12003 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12004 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12005 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12006 | 1 \ |
| 12007 | -c "got a certificate request" \ |
| 12008 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12009 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12010 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12011 | -C "unkown pk type" |
| 12012 | |
| 12013 | requires_gnutls_tls1_3 |
| 12014 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12015 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12016 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12017 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12018 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12020 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12021 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12022 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12023 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12024 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12025 | 1 \ |
| 12026 | -c "got a certificate request" \ |
| 12027 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12028 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12029 | -c "no suitable signature algorithm" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12030 | -C "unkown pk type" |
| 12031 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12032 | requires_openssl_tls1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12033 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12034 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12035 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12036 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12037 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12038 | "$O_NEXT_SRV -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12039 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12040 | 0 \ |
| 12041 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12042 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12043 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12044 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12045 | -c "HTTP/1.0 200 ok" |
| 12046 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12047 | requires_openssl_tls1_3 |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12048 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12049 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12050 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12051 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12052 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12053 | "$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12054 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12055 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12056 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12057 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12058 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12059 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12060 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12061 | |
| 12062 | requires_gnutls_tls1_3 |
| 12063 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12065 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12066 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12067 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12068 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12069 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-128-GCM:+SHA256:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12070 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12071 | 0 \ |
| 12072 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12073 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12074 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12075 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12076 | -c "HTTP/1.0 200 OK" |
| 12077 | |
| 12078 | requires_gnutls_tls1_3 |
| 12079 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12080 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12081 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12082 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12083 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12084 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12085 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12086 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12087 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12088 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12089 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12090 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12091 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12092 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12093 | |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12094 | requires_openssl_tls1_3 |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12095 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12096 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12097 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12098 | run_test "TLS 1.3: Server side check - openssl" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12099 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12100 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12101 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12102 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12103 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12104 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12105 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12106 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12107 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12108 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12109 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12110 | |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12111 | requires_openssl_tls1_3 |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12112 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12113 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12114 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12115 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12116 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 12117 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 12118 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12119 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12120 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12121 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12122 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12123 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12124 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12125 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12126 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12127 | -s "=> parse client hello" \ |
| 12128 | -s "<= parse client hello" |
| 12129 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12130 | requires_gnutls_tls1_3 |
| 12131 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12132 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12133 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12134 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12135 | run_test "TLS 1.3: Server side check - gnutls" \ |
XiaokangQian | c4b8c99 | 2022-04-07 11:31:38 +0000 | [diff] [blame] | 12136 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 12137 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12138 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12139 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12140 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12141 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12142 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12143 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12144 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12145 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12146 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12147 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12148 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12149 | requires_gnutls_tls1_3 |
| 12150 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12151 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12152 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12153 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12154 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12155 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12156 | "$G_NEXT_CLI localhost -d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12157 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12158 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12159 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12160 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12161 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12162 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12163 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12164 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12165 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12166 | -s "=> parse client hello" \ |
| 12167 | -s "<= parse client hello" |
| 12168 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12169 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12170 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12171 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12172 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12173 | run_test "TLS 1.3: Server side check - mbedtls" \ |
| 12174 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12175 | "$P_CLI debug_level=4 force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12176 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12177 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12178 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12179 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12180 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12181 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12182 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12183 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12184 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12185 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12186 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12187 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12188 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12189 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12190 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12191 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12192 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12193 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12194 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12195 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12196 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12197 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12198 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12199 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12200 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12201 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12202 | -s "=> parse client hello" \ |
| 12203 | -s "<= parse client hello" |
| 12204 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12205 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12206 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12207 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12208 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12209 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
| 12210 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12211 | "$P_CLI debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12212 | 1 \ |
| 12213 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12214 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12215 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12216 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12217 | -s "=> write certificate request" \ |
| 12218 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12219 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12220 | -s "=> parse client hello" \ |
| 12221 | -s "<= parse client hello" |
| 12222 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12223 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12224 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12225 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12226 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12227 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
| 12228 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
| 12229 | "$P_CLI debug_level=4 force_version=tls13 crt_file=none key_file=none" \ |
| 12230 | 0 \ |
| 12231 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12232 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12233 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12234 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12235 | -s "=> write certificate request" \ |
| 12236 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12237 | -s "=> parse client hello" \ |
| 12238 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12239 | |
| 12240 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12241 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12242 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12243 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12244 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
| 12245 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1" \ |
| 12246 | "$P_CLI debug_level=4 force_version=tls13 curves=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12247 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12248 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12249 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12250 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12251 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12252 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12253 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12254 | -s "=> write hello retry request" \ |
| 12255 | -s "<= write hello retry request" |
| 12256 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12257 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12258 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12259 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12260 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12261 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
| 12262 | "$P_SRV debug_level=4 crt_file=none key_file=none force_version=tls13" \ |
| 12263 | "$P_CLI debug_level=4 force_version=tls13" \ |
| 12264 | 1 \ |
| 12265 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12266 | -s "No certificate available." |
| 12267 | |
XiaokangQian | f4f0f69 | 2022-06-01 00:42:27 +0000 | [diff] [blame] | 12268 | requires_openssl_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12269 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12270 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12271 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12272 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12273 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12274 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12275 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12276 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_files/server5.crt -key data_files/server5.key -tls1_3" \ |
| 12277 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12278 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12279 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12280 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12281 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12282 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12283 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12284 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12285 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12286 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12287 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12288 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12289 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
| 12290 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12291 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12292 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12293 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12294 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12295 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12297 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12298 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12299 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12300 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0 \ |
| 12301 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 12302 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 12303 | force_version=tls13" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12304 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12305 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12306 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12307 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12308 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12309 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12310 | TEST_SUITE_NAME=${i##*/} |
| 12311 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12312 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12313 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12314 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12315 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12316 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12317 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12318 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12319 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12320 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12321 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12322 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
| 12323 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12324 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12325 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12326 | -s "Protocol is TLSv1.3" \ |
| 12327 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12328 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12329 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12330 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12331 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12332 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12333 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12334 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12335 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12336 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
| 12337 | "$P_SRV debug_level=4 force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12338 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12339 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12340 | -s "Protocol is TLSv1.3" \ |
| 12341 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12342 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12343 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12344 | |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12345 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12346 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12347 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12348 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12349 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12350 | 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] | 12351 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12352 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12353 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12354 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12355 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12356 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12357 | |
| 12358 | requires_openssl_tls1_3 |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12359 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12360 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12361 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12362 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12363 | 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] | 12364 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12365 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12366 | 1 \ |
| 12367 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12368 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12369 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12370 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12371 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12372 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12373 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12374 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12375 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12376 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12377 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12378 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12379 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12380 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12381 | requires_gnutls_tls1_3 |
| 12382 | requires_gnutls_next_no_ticket |
| 12383 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12384 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12385 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12386 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12387 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12388 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12389 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12390 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12391 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12392 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12393 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12394 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12395 | |
| 12396 | requires_gnutls_tls1_3 |
| 12397 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12398 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12399 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12400 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12402 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12403 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12404 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12405 | 1 \ |
| 12406 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12407 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12408 | requires_gnutls_tls1_3 |
| 12409 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12410 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12411 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12412 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12413 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12414 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12415 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12416 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12417 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12418 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12419 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12420 | |
| 12421 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12422 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12423 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12424 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12425 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12426 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
| 12427 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12428 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12429 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12430 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12431 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12432 | -C "14 03 03 00 01" |
| 12433 | |
| 12434 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12435 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12436 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12437 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12438 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12439 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
| 12440 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12441 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12442 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12443 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12444 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12445 | |
| 12446 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12447 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12448 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12449 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12450 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12451 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
| 12452 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12453 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12454 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12455 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12456 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12457 | -c "14 03 03 00 01" |
| 12458 | |
| 12459 | requires_gnutls_tls1_3 |
| 12460 | requires_gnutls_next_no_ticket |
| 12461 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12462 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12463 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12464 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12465 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12466 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
| 12467 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12468 | "$G_NEXT_CLI localhost --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12469 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12470 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12471 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12472 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12473 | |
| 12474 | requires_gnutls_tls1_3 |
| 12475 | requires_gnutls_next_no_ticket |
| 12476 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12477 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12478 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12479 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12480 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12481 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
| 12482 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12483 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12484 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12485 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12486 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12487 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12488 | -c "discarding change cipher spec in TLS1.3" |
| 12489 | |
| 12490 | requires_gnutls_tls1_3 |
| 12491 | requires_gnutls_next_no_ticket |
| 12492 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12493 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12494 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12495 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12496 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12497 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
| 12498 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12499 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12500 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12501 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12502 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12503 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12504 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12505 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12506 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12507 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12508 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12509 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12510 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
| 12511 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12512 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12513 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12514 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12515 | -c "Protocol is TLSv1.3" \ |
| 12516 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12517 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12518 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12519 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12520 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12521 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12522 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12523 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12524 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12525 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
| 12526 | "$P_SRV debug_level=4 force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12527 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12528 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12529 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12530 | -c "Protocol is TLSv1.3" \ |
| 12531 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12532 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12533 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12534 | |
| 12535 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12536 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12537 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12538 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12539 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12540 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12541 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -no_middlebox -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12542 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12543 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12544 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12545 | -c "received HelloRetryRequest message" \ |
| 12546 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12547 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12548 | |
| 12549 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12550 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12551 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12552 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12553 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12554 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12555 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12556 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12557 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12558 | -c "received HelloRetryRequest message" \ |
| 12559 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12560 | |
| 12561 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12562 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12563 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12564 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12565 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12566 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12567 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12568 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12569 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12570 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12571 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12572 | |
| 12573 | requires_gnutls_tls1_3 |
| 12574 | requires_gnutls_next_no_ticket |
| 12575 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12576 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12577 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12578 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12579 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12580 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12581 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12582 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12583 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12584 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12585 | -c "received HelloRetryRequest message" \ |
| 12586 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12587 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12588 | |
| 12589 | requires_gnutls_tls1_3 |
| 12590 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12591 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12592 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12593 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12594 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12595 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12596 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12597 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12598 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12599 | -c "received HelloRetryRequest message" \ |
| 12600 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12601 | |
| 12602 | requires_gnutls_tls1_3 |
| 12603 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12604 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12605 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12606 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12607 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12608 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12609 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12610 | "$P_CLI debug_level=4 curves=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12611 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12612 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12613 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12614 | |
| 12615 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12616 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12617 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12618 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12619 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12620 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
| 12621 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12622 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12623 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12624 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12625 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12626 | -C "14 03 03 00 01" |
| 12627 | |
| 12628 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12629 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12630 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12631 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12632 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12633 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
| 12634 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12635 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12636 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12637 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12638 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12639 | |
| 12640 | requires_openssl_tls1_3 |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12641 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12642 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12643 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12644 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12645 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
| 12646 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12647 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12648 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12649 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12650 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12651 | -c "14 03 03 00 01" |
| 12652 | |
| 12653 | requires_gnutls_tls1_3 |
| 12654 | requires_gnutls_next_no_ticket |
| 12655 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12656 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12657 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12658 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12659 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12660 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
| 12661 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12662 | "$G_NEXT_CLI localhost --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12663 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12664 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12665 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12666 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12667 | |
| 12668 | requires_gnutls_tls1_3 |
| 12669 | requires_gnutls_next_no_ticket |
| 12670 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12671 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12672 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12673 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12674 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12675 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
| 12676 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12677 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12678 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12679 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12680 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12681 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12682 | -c "discarding change cipher spec in TLS1.3" |
| 12683 | |
| 12684 | requires_gnutls_tls1_3 |
| 12685 | requires_gnutls_next_no_ticket |
| 12686 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12687 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12688 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12689 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12690 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12691 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
| 12692 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 curves=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12693 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12694 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12695 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12696 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12697 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12698 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12699 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12700 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12701 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12702 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12703 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12704 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12705 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12706 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12707 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12708 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12709 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12710 | 0 \ |
| 12711 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12712 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12713 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12714 | |
| 12715 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12716 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12717 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12718 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12719 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12720 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12721 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12722 | -d 4 |
| 12723 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 12724 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12725 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12726 | 0 \ |
| 12727 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12728 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12729 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12730 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12732 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12733 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12734 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12735 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12736 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
| 12737 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12738 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12739 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12740 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12741 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12742 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12743 | 0 \ |
| 12744 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12745 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12746 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12747 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12748 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12749 | |
| 12750 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12751 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12752 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12753 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12754 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12755 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
| 12756 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12757 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12758 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12759 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12760 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12761 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12762 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12763 | 0 \ |
| 12764 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12765 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12766 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12767 | |
| 12768 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12769 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12770 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12771 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12772 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12773 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
| 12774 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12775 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12776 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12777 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12778 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12779 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12780 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12781 | 0 \ |
| 12782 | -c "Negotiated version: 3.4" \ |
| 12783 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12784 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12785 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12786 | |
| 12787 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12788 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12789 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12790 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12791 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12792 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
| 12793 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12794 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12795 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12796 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12797 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12798 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12799 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12800 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12801 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12802 | |
| 12803 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12804 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12805 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12806 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12807 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12808 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
| 12809 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12810 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12811 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12812 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12813 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12814 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12815 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12816 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12817 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12818 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12819 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12820 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12821 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12822 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12823 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12824 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
| 12825 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12826 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12827 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12828 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12829 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12830 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12831 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12832 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12833 | |
| 12834 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12835 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12836 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12837 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12838 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12839 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
| 12840 | "$P_SRV debug_level=4 force_version=tls13 |
| 12841 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12842 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12843 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12844 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12845 | 1 \ |
| 12846 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12847 | |
| 12848 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12849 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12850 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12851 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12852 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12853 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
| 12854 | "$P_SRV debug_level=4 force_version=tls13 |
| 12855 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12856 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12857 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12858 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12859 | 1 \ |
| 12860 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12861 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12862 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12863 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12864 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12865 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12866 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12867 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
| 12868 | "$P_SRV debug_level=4 force_version=tls13 |
| 12869 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12870 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12871 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12872 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12873 | 1 \ |
| 12874 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12875 | |
| 12876 | requires_openssl_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12877 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12878 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12879 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12880 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12881 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12882 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12883 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12884 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 12885 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12886 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12887 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12888 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12889 | |
| 12890 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12891 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12892 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12893 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12894 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12895 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 12896 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12897 | -d 4 |
| 12898 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 12899 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12900 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12901 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12902 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12903 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12905 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12909 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
| 12910 | "$P_SRV debug_level=4 force_version=tls13 auth_mode=required |
| 12911 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12912 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12913 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 12914 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12915 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12916 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12917 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12918 | |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12919 | requires_openssl_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12922 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12923 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12924 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12925 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12926 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 12927 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12928 | 0 \ |
| 12929 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12930 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12931 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12932 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12933 | -c "HTTP/1.0 200 ok" |
| 12934 | |
| 12935 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12936 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12938 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12939 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12940 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12941 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 12942 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12943 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12944 | 0 \ |
| 12945 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 12946 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12947 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12948 | -c "Reconnecting with saved session" \ |
| 12949 | -c "HTTP/1.0 200 OK" \ |
| 12950 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12951 | |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12952 | requires_openssl_tls1_3 |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12953 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12954 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12955 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12956 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12957 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12958 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12959 | # https://github.com/openssl/openssl/issues/10714 |
| 12960 | # Until now, OpenSSL client does not support reconnect. |
| 12961 | skip_next_test |
| 12962 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
| 12963 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12964 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 12965 | 0 \ |
| 12966 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12967 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12968 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12969 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12970 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12971 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12972 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12973 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12974 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12975 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12976 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12977 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12978 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 12979 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12980 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12981 | -c "Connecting again- trying to resume previous session" \ |
| 12982 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12983 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 12984 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 12985 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 12986 | -s "key exchange mode: ephemeral" \ |
| 12987 | -s "key exchange mode: psk_ephemeral" \ |
| 12988 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12989 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12990 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 12991 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12992 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12993 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12994 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12995 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 12996 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 12997 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 12998 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 12999 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13000 | 0 \ |
| 13001 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13002 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13003 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13004 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13005 | -c "HTTP/1.0 200 OK" \ |
| 13006 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13007 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13008 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13009 | -s "key exchange mode: ephemeral" \ |
| 13010 | -s "key exchange mode: psk_ephemeral" \ |
| 13011 | -s "found pre_shared_key extension" |
| 13012 | |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13013 | requires_openssl_tls1_3 |
| 13014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13015 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13016 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13017 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13018 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13019 | -msg -tls1_2 |
| 13020 | -Verify 10 " \ |
| 13021 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13022 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13023 | min_version=tls12 max_version=tls13 " \ |
| 13024 | 0 \ |
| 13025 | -c "Protocol is TLSv1.2" \ |
| 13026 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13027 | |
| 13028 | |
| 13029 | requires_gnutls_tls1_3 |
| 13030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13031 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13032 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13033 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13034 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13035 | -d 4 |
| 13036 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13037 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13038 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13039 | min_version=tls12 max_version=tls13 " \ |
| 13040 | 0 \ |
| 13041 | -c "Protocol is TLSv1.2" \ |
| 13042 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13043 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13044 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13045 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13046 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13047 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13048 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13049 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13050 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13051 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13052 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13053 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13054 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13055 | 0 \ |
| 13056 | -c "Protocol is TLSv1.3" \ |
| 13057 | -c "got new session ticket." \ |
| 13058 | -c "Saving session for reuse... ok" \ |
| 13059 | -c "Reconnecting with saved session" \ |
| 13060 | -c "HTTP/1.0 200 OK" \ |
| 13061 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13062 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13063 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13064 | -s "key exchange mode: ephemeral" \ |
| 13065 | -s "key exchange mode: psk_ephemeral" \ |
| 13066 | -s "found pre_shared_key extension" |
| 13067 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13068 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13069 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13070 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13071 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13072 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13073 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13074 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13075 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Xiaokang Qian | 2f9efd3 | 2022-10-10 11:24:08 +0000 | [diff] [blame] | 13076 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13077 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Jerry Yu | ad9e99b | 2022-10-28 12:18:52 +0800 | [diff] [blame] | 13078 | "$P_CLI debug_level=4 server_name=localhost reco_server_name=remote reco_mode=1 reconnect=1" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13079 | 1 \ |
| 13080 | -c "Protocol is TLSv1.3" \ |
| 13081 | -c "got new session ticket." \ |
| 13082 | -c "Saving session for reuse... ok" \ |
| 13083 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13084 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13085 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13086 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13087 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13088 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13089 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13091 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13092 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13093 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13094 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13095 | run_tests_memory_after_hanshake |
| 13096 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13097 | # Final report |
| 13098 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13099 | echo "------------------------------------------------------------------------" |
| 13100 | |
| 13101 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13102 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13103 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 13104 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13105 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 13106 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 13107 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13108 | |
| 13109 | exit $FAILS |