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 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else |
| 25 | echo "cd $( dirname $0 ) failed" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 29 | # default values, can be overriden by the environment |
| 30 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 31 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} |
| 35 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | 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] | 39 | 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] | 40 | 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] | 41 | 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] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 44 | TESTS=0 |
| 45 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 46 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 47 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 48 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 49 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 50 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 51 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 52 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 53 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 54 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 55 | RUN_TEST_NUMBER='' |
| 56 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 57 | PRESERVE_LOGS=0 |
| 58 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 59 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 60 | # port which is this plus 10000. Each port number may be independently |
| 61 | # overridden by a command line option. |
| 62 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 63 | PXY_PORT=$((SRV_PORT + 10000)) |
| 64 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 65 | print_usage() { |
| 66 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 67 | printf " -h|--help\tPrint this help.\n" |
| 68 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 69 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 70 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 71 | 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] | 72 | 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] | 73 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 74 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 75 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 76 | 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] | 77 | } |
| 78 | |
| 79 | get_options() { |
| 80 | while [ $# -gt 0 ]; do |
| 81 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 82 | -f|--filter) |
| 83 | shift; FILTER=$1 |
| 84 | ;; |
| 85 | -e|--exclude) |
| 86 | shift; EXCLUDE=$1 |
| 87 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 88 | -m|--memcheck) |
| 89 | MEMCHECK=1 |
| 90 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 91 | -n|--number) |
| 92 | shift; RUN_TEST_NUMBER=$1 |
| 93 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 94 | -s|--show-numbers) |
| 95 | SHOW_TEST_NUMBER=1 |
| 96 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 97 | -p|--preserve-logs) |
| 98 | PRESERVE_LOGS=1 |
| 99 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 100 | --port) |
| 101 | shift; SRV_PORT=$1 |
| 102 | ;; |
| 103 | --proxy-port) |
| 104 | shift; PXY_PORT=$1 |
| 105 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 106 | --seed) |
| 107 | shift; SEED="$1" |
| 108 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 109 | -h|--help) |
| 110 | print_usage |
| 111 | exit 0 |
| 112 | ;; |
| 113 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 114 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 115 | print_usage |
| 116 | exit 1 |
| 117 | ;; |
| 118 | esac |
| 119 | shift |
| 120 | done |
| 121 | } |
| 122 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 123 | # skip next test if the flag is not enabled in config.h |
| 124 | requires_config_enabled() { |
| 125 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 126 | SKIP_NEXT="YES" |
| 127 | fi |
| 128 | } |
| 129 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 130 | # skip next test if the flag is enabled in config.h |
| 131 | requires_config_disabled() { |
| 132 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 133 | SKIP_NEXT="YES" |
| 134 | fi |
| 135 | } |
| 136 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 137 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 138 | requires_openssl_with_fallback_scsv() { |
| 139 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 140 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 141 | then |
| 142 | OPENSSL_HAS_FBSCSV="YES" |
| 143 | else |
| 144 | OPENSSL_HAS_FBSCSV="NO" |
| 145 | fi |
| 146 | fi |
| 147 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 148 | SKIP_NEXT="YES" |
| 149 | fi |
| 150 | } |
| 151 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 152 | # skip next test if GnuTLS isn't available |
| 153 | requires_gnutls() { |
| 154 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 155 | 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] | 156 | GNUTLS_AVAILABLE="YES" |
| 157 | else |
| 158 | GNUTLS_AVAILABLE="NO" |
| 159 | fi |
| 160 | fi |
| 161 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 162 | SKIP_NEXT="YES" |
| 163 | fi |
| 164 | } |
| 165 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 166 | # skip next test if IPv6 isn't available on this host |
| 167 | requires_ipv6() { |
| 168 | if [ -z "${HAS_IPV6:-}" ]; then |
| 169 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 170 | SRV_PID=$! |
| 171 | sleep 1 |
| 172 | kill $SRV_PID >/dev/null 2>&1 |
| 173 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 174 | HAS_IPV6="NO" |
| 175 | else |
| 176 | HAS_IPV6="YES" |
| 177 | fi |
| 178 | rm -r $SRV_OUT |
| 179 | fi |
| 180 | |
| 181 | if [ "$HAS_IPV6" = "NO" ]; then |
| 182 | SKIP_NEXT="YES" |
| 183 | fi |
| 184 | } |
| 185 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 186 | # Calculate the input & output maximum content lengths set in the config |
| 187 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 188 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 189 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 190 | |
| 191 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 192 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 193 | fi |
| 194 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 195 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 196 | fi |
| 197 | |
| 198 | # skip the next test if the SSL output buffer is less than 16KB |
| 199 | requires_full_size_output_buffer() { |
| 200 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 201 | SKIP_NEXT="YES" |
| 202 | fi |
| 203 | } |
| 204 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 205 | # skip the next test if valgrind is in use |
| 206 | not_with_valgrind() { |
| 207 | if [ "$MEMCHECK" -gt 0 ]; then |
| 208 | SKIP_NEXT="YES" |
| 209 | fi |
| 210 | } |
| 211 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 212 | # skip the next test if valgrind is NOT in use |
| 213 | only_with_valgrind() { |
| 214 | if [ "$MEMCHECK" -eq 0 ]; then |
| 215 | SKIP_NEXT="YES" |
| 216 | fi |
| 217 | } |
| 218 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 219 | # 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] | 220 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 221 | CLI_DELAY_FACTOR=$1 |
| 222 | } |
| 223 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 224 | # wait for the given seconds after the client finished in the next test |
| 225 | server_needs_more_time() { |
| 226 | SRV_DELAY_SECONDS=$1 |
| 227 | } |
| 228 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 229 | # print_name <name> |
| 230 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 231 | TESTS=$(( $TESTS + 1 )) |
| 232 | LINE="" |
| 233 | |
| 234 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 235 | LINE="$TESTS " |
| 236 | fi |
| 237 | |
| 238 | LINE="$LINE$1" |
| 239 | printf "$LINE " |
| 240 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 241 | for i in `seq 1 $LEN`; do printf '.'; done |
| 242 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 243 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | # fail <message> |
| 247 | fail() { |
| 248 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 249 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 250 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 251 | mv $SRV_OUT o-srv-${TESTS}.log |
| 252 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 253 | if [ -n "$PXY_CMD" ]; then |
| 254 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 255 | fi |
| 256 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 257 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 258 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 259 | echo " ! server output:" |
| 260 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 261 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 262 | echo " ! client output:" |
| 263 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 264 | if [ -n "$PXY_CMD" ]; then |
| 265 | echo " ! ========================================================" |
| 266 | echo " ! proxy output:" |
| 267 | cat o-pxy-${TESTS}.log |
| 268 | fi |
| 269 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 270 | fi |
| 271 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 272 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 273 | } |
| 274 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 275 | # is_polar <cmd_line> |
| 276 | is_polar() { |
| 277 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 278 | } |
| 279 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 280 | # openssl s_server doesn't have -www with DTLS |
| 281 | check_osrv_dtls() { |
| 282 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 283 | NEEDS_INPUT=1 |
| 284 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 285 | else |
| 286 | NEEDS_INPUT=0 |
| 287 | fi |
| 288 | } |
| 289 | |
| 290 | # provide input to commands that need it |
| 291 | provide_input() { |
| 292 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 293 | return |
| 294 | fi |
| 295 | |
| 296 | while true; do |
| 297 | echo "HTTP/1.0 200 OK" |
| 298 | sleep 1 |
| 299 | done |
| 300 | } |
| 301 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 302 | # has_mem_err <log_file_name> |
| 303 | has_mem_err() { |
| 304 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 305 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 306 | then |
| 307 | return 1 # false: does not have errors |
| 308 | else |
| 309 | return 0 # true: has errors |
| 310 | fi |
| 311 | } |
| 312 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 313 | # Wait for process $2 to be listening on port $1 |
| 314 | if type lsof >/dev/null 2>/dev/null; then |
| 315 | wait_server_start() { |
| 316 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 317 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 318 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 319 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 320 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 321 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 322 | # Make a tight loop, server normally takes less than 1s to start. |
| 323 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 324 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 325 | echo "SERVERSTART TIMEOUT" |
| 326 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 327 | break |
| 328 | fi |
| 329 | # Linux and *BSD support decimal arguments to sleep. On other |
| 330 | # OSes this may be a tight loop. |
| 331 | sleep 0.1 2>/dev/null || true |
| 332 | done |
| 333 | } |
| 334 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 335 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 336 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 337 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 338 | } |
| 339 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 340 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 341 | # 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] | 342 | # 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] | 343 | # acceptable bounds |
| 344 | check_server_hello_time() { |
| 345 | # 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] | 346 | 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] | 347 | # Get the Unix timestamp for now |
| 348 | CUR_TIME=$(date +'%s') |
| 349 | THRESHOLD_IN_SECS=300 |
| 350 | |
| 351 | # Check if the ServerHello time was printed |
| 352 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 353 | return 1 |
| 354 | fi |
| 355 | |
| 356 | # Check the time in ServerHello is within acceptable bounds |
| 357 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 358 | # The time in ServerHello is at least 5 minutes before now |
| 359 | return 1 |
| 360 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 361 | # 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] | 362 | return 1 |
| 363 | else |
| 364 | return 0 |
| 365 | fi |
| 366 | } |
| 367 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 368 | # wait for client to terminate and set CLI_EXIT |
| 369 | # must be called right after starting the client |
| 370 | wait_client_done() { |
| 371 | CLI_PID=$! |
| 372 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 373 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 374 | CLI_DELAY_FACTOR=1 |
| 375 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 376 | ( 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] | 377 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 378 | |
| 379 | wait $CLI_PID |
| 380 | CLI_EXIT=$? |
| 381 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 382 | kill $DOG_PID >/dev/null 2>&1 |
| 383 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 384 | |
| 385 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 386 | |
| 387 | sleep $SRV_DELAY_SECONDS |
| 388 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 389 | } |
| 390 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 391 | # check if the given command uses dtls and sets global variable DTLS |
| 392 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 393 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 394 | DTLS=1 |
| 395 | else |
| 396 | DTLS=0 |
| 397 | fi |
| 398 | } |
| 399 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 400 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 401 | # Options: -s pattern pattern that must be present in server output |
| 402 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 403 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 404 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 405 | # -S pattern pattern that must be absent in server output |
| 406 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 407 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 408 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 409 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 410 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 411 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 412 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 413 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 414 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 415 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 416 | return |
| 417 | fi |
| 418 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 419 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 420 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 421 | # Do we only run numbered tests? |
| 422 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 423 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 424 | else |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 428 | # should we skip? |
| 429 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 430 | SKIP_NEXT="NO" |
| 431 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 432 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 433 | return |
| 434 | fi |
| 435 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 436 | # does this test use a proxy? |
| 437 | if [ "X$1" = "X-p" ]; then |
| 438 | PXY_CMD="$2" |
| 439 | shift 2 |
| 440 | else |
| 441 | PXY_CMD="" |
| 442 | fi |
| 443 | |
| 444 | # get commands and client output |
| 445 | SRV_CMD="$1" |
| 446 | CLI_CMD="$2" |
| 447 | CLI_EXPECT="$3" |
| 448 | shift 3 |
| 449 | |
| 450 | # fix client port |
| 451 | if [ -n "$PXY_CMD" ]; then |
| 452 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 453 | else |
| 454 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 455 | fi |
| 456 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 457 | # update DTLS variable |
| 458 | detect_dtls "$SRV_CMD" |
| 459 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 460 | # prepend valgrind to our commands if active |
| 461 | if [ "$MEMCHECK" -gt 0 ]; then |
| 462 | if is_polar "$SRV_CMD"; then |
| 463 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 464 | fi |
| 465 | if is_polar "$CLI_CMD"; then |
| 466 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 467 | fi |
| 468 | fi |
| 469 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 470 | TIMES_LEFT=2 |
| 471 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 472 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 473 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 474 | # run the commands |
| 475 | if [ -n "$PXY_CMD" ]; then |
| 476 | echo "$PXY_CMD" > $PXY_OUT |
| 477 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 478 | PXY_PID=$! |
| 479 | # assume proxy starts faster than server |
| 480 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 481 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 482 | check_osrv_dtls |
| 483 | echo "$SRV_CMD" > $SRV_OUT |
| 484 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 485 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 486 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 487 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 488 | echo "$CLI_CMD" > $CLI_OUT |
| 489 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 490 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 491 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 492 | sleep 0.05 |
| 493 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 494 | # terminate the server (and the proxy) |
| 495 | kill $SRV_PID |
| 496 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 497 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 498 | if [ -n "$PXY_CMD" ]; then |
| 499 | kill $PXY_PID >/dev/null 2>&1 |
| 500 | wait $PXY_PID |
| 501 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 502 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 503 | # retry only on timeouts |
| 504 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 505 | printf "RETRY " |
| 506 | else |
| 507 | TIMES_LEFT=0 |
| 508 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 509 | done |
| 510 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 511 | # 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] | 512 | # (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] | 513 | # expected client exit to incorrectly succeed in case of catastrophic |
| 514 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 515 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 516 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 517 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 518 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 519 | return |
| 520 | fi |
| 521 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 522 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 523 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 524 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 525 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 526 | return |
| 527 | fi |
| 528 | fi |
| 529 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 530 | # check server exit code |
| 531 | if [ $? != 0 ]; then |
| 532 | fail "server fail" |
| 533 | return |
| 534 | fi |
| 535 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 536 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 537 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 538 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 539 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 540 | 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] | 541 | return |
| 542 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 544 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 545 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 546 | # 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] | 547 | while [ $# -gt 0 ] |
| 548 | do |
| 549 | case $1 in |
| 550 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 551 | 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] | 552 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 553 | return |
| 554 | fi |
| 555 | ;; |
| 556 | |
| 557 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 558 | 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] | 559 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 560 | return |
| 561 | fi |
| 562 | ;; |
| 563 | |
| 564 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 565 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 566 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 567 | return |
| 568 | fi |
| 569 | ;; |
| 570 | |
| 571 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 572 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 573 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 574 | return |
| 575 | fi |
| 576 | ;; |
| 577 | |
| 578 | # The filtering in the following two options (-u and -U) do the following |
| 579 | # - ignore valgrind output |
| 580 | # - filter out everything but lines right after the pattern occurances |
| 581 | # - keep one of each non-unique line |
| 582 | # - count how many lines remain |
| 583 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 584 | # if there were no duplicates. |
| 585 | "-U") |
| 586 | 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 |
| 587 | fail "lines following pattern '$2' must be unique in Server output" |
| 588 | return |
| 589 | fi |
| 590 | ;; |
| 591 | |
| 592 | "-u") |
| 593 | 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 |
| 594 | 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] | 595 | return |
| 596 | fi |
| 597 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 598 | "-F") |
| 599 | if ! $2 "$SRV_OUT"; then |
| 600 | fail "function call to '$2' failed on Server output" |
| 601 | return |
| 602 | fi |
| 603 | ;; |
| 604 | "-f") |
| 605 | if ! $2 "$CLI_OUT"; then |
| 606 | fail "function call to '$2' failed on Client output" |
| 607 | return |
| 608 | fi |
| 609 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 610 | |
| 611 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 612 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 613 | exit 1 |
| 614 | esac |
| 615 | shift 2 |
| 616 | done |
| 617 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 618 | # check valgrind's results |
| 619 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 620 | 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] | 621 | fail "Server has memory errors" |
| 622 | return |
| 623 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 624 | 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] | 625 | fail "Client has memory errors" |
| 626 | return |
| 627 | fi |
| 628 | fi |
| 629 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 630 | # if we're here, everything is ok |
| 631 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 632 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 633 | mv $SRV_OUT o-srv-${TESTS}.log |
| 634 | mv $CLI_OUT o-cli-${TESTS}.log |
| 635 | fi |
| 636 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 637 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 638 | } |
| 639 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 640 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 641 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 642 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 643 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 644 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 645 | 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] | 646 | exit 1 |
| 647 | } |
| 648 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 649 | # |
| 650 | # MAIN |
| 651 | # |
| 652 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 653 | get_options "$@" |
| 654 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 655 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 656 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 657 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 658 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 659 | if [ ! -x "$P_SRV_BIN" ]; then |
| 660 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 661 | exit 1 |
| 662 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 663 | if [ ! -x "$P_CLI_BIN" ]; then |
| 664 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 665 | exit 1 |
| 666 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 667 | if [ ! -x "$P_PXY_BIN" ]; then |
| 668 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 669 | exit 1 |
| 670 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 671 | if [ "$MEMCHECK" -gt 0 ]; then |
| 672 | if which valgrind >/dev/null 2>&1; then :; else |
| 673 | echo "Memcheck not possible. Valgrind not found" |
| 674 | exit 1 |
| 675 | fi |
| 676 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 677 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 678 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 679 | exit 1 |
| 680 | fi |
| 681 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 682 | # used by watchdog |
| 683 | MAIN_PID="$$" |
| 684 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 685 | # We use somewhat arbitrary delays for tests: |
| 686 | # - how long do we wait for the server to start (when lsof not available)? |
| 687 | # - how long do we allow for the client to finish? |
| 688 | # (not to check performance, just to avoid waiting indefinitely) |
| 689 | # Things are slower with valgrind, so give extra time here. |
| 690 | # |
| 691 | # Note: without lsof, there is a trade-off between the running time of this |
| 692 | # script and the risk of spurious errors because we didn't wait long enough. |
| 693 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 694 | # 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] | 695 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 696 | START_DELAY=6 |
| 697 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 698 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 699 | START_DELAY=2 |
| 700 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 701 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 702 | |
| 703 | # some particular tests need more time: |
| 704 | # - for the client, we multiply the usual watchdog limit by a factor |
| 705 | # - for the server, we sleep for a number of seconds after the client exits |
| 706 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 707 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 708 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 709 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 710 | # 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] | 711 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 712 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 713 | 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] | 714 | 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"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 715 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 716 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 717 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 718 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 719 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 720 | # Allow SHA-1, because many of our test certificates use it |
| 721 | P_SRV="$P_SRV allow_sha1=1" |
| 722 | P_CLI="$P_CLI allow_sha1=1" |
| 723 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 724 | # Also pick a unique name for intermediate files |
| 725 | SRV_OUT="srv_out.$$" |
| 726 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 727 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 728 | SESSION="session.$$" |
| 729 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 730 | SKIP_NEXT="NO" |
| 731 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 732 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 733 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 734 | # Basic test |
| 735 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 736 | # Checks that: |
| 737 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 738 | # - the expected (highest security) parameters are selected |
| 739 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 740 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 741 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 742 | "$P_CLI" \ |
| 743 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 744 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 745 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 746 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 747 | -s "ECDHE curve: secp521r1" \ |
| 748 | -S "error" \ |
| 749 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 750 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 751 | run_test "Default, DTLS" \ |
| 752 | "$P_SRV dtls=1" \ |
| 753 | "$P_CLI dtls=1" \ |
| 754 | 0 \ |
| 755 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 756 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 757 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 758 | # Test current time in ServerHello |
| 759 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 760 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 761 | "$P_SRV debug_level=3" \ |
| 762 | "$P_CLI debug_level=3" \ |
| 763 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 764 | -f "check_server_hello_time" \ |
| 765 | -F "check_server_hello_time" |
| 766 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 767 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 768 | run_test "Unique IV in GCM" \ |
| 769 | "$P_SRV exchanges=20 debug_level=4" \ |
| 770 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 771 | 0 \ |
| 772 | -u "IV used" \ |
| 773 | -U "IV used" |
| 774 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 775 | # Tests for rc4 option |
| 776 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 777 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 778 | run_test "RC4: server disabled, client enabled" \ |
| 779 | "$P_SRV" \ |
| 780 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 781 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 782 | -s "SSL - The server has no ciphersuites in common" |
| 783 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 784 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 785 | run_test "RC4: server half, client enabled" \ |
| 786 | "$P_SRV arc4=1" \ |
| 787 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 788 | 1 \ |
| 789 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 790 | |
| 791 | run_test "RC4: server enabled, client disabled" \ |
| 792 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 793 | "$P_CLI" \ |
| 794 | 1 \ |
| 795 | -s "SSL - The server has no ciphersuites in common" |
| 796 | |
| 797 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 798 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 799 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 800 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 801 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 802 | -S "SSL - The server has no ciphersuites in common" |
| 803 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 804 | # Tests for SHA-1 support |
| 805 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 806 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 807 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 808 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 809 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 810 | 1 \ |
| 811 | -c "The certificate is signed with an unacceptable hash" |
| 812 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 813 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 814 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 815 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 816 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 817 | 0 |
| 818 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 819 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 820 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 821 | "$P_CLI allow_sha1=1" \ |
| 822 | 0 |
| 823 | |
| 824 | run_test "SHA-256 allowed by default in server certificate" \ |
| 825 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 826 | "$P_CLI allow_sha1=0" \ |
| 827 | 0 |
| 828 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 829 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 830 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 831 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 832 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 833 | 1 \ |
| 834 | -s "The certificate is signed with an unacceptable hash" |
| 835 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 836 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 837 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 838 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 839 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 840 | 0 |
| 841 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 842 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 843 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 844 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 845 | 0 |
| 846 | |
| 847 | run_test "SHA-256 allowed by default in client certificate" \ |
| 848 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 849 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 850 | 0 |
| 851 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 852 | # Tests for Truncated HMAC extension |
| 853 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 854 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 855 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 856 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 857 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 858 | -s "dumping 'expected mac' (20 bytes)" \ |
| 859 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 860 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 861 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 862 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 863 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 864 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 865 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 866 | -s "dumping 'expected mac' (20 bytes)" \ |
| 867 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 868 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 869 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 870 | run_test "Truncated HMAC: client enabled, server default" \ |
| 871 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 872 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 873 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 874 | -s "dumping 'expected mac' (20 bytes)" \ |
| 875 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 876 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 877 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 878 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 879 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 880 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 881 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 882 | -s "dumping 'expected mac' (20 bytes)" \ |
| 883 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 884 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 885 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 886 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 887 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 888 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 889 | 0 \ |
| 890 | -s "dumping 'expected mac' (20 bytes)" \ |
| 891 | -S "dumping 'expected mac' (10 bytes)" |
| 892 | |
| 893 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 894 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 895 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 896 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 897 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 898 | -S "dumping 'expected mac' (20 bytes)" \ |
| 899 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 900 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 901 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 902 | "$P_SRV dtls=1 debug_level=4" \ |
| 903 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 904 | 0 \ |
| 905 | -s "dumping 'expected mac' (20 bytes)" \ |
| 906 | -S "dumping 'expected mac' (10 bytes)" |
| 907 | |
| 908 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 909 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 910 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 911 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 912 | 0 \ |
| 913 | -s "dumping 'expected mac' (20 bytes)" \ |
| 914 | -S "dumping 'expected mac' (10 bytes)" |
| 915 | |
| 916 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 917 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 918 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 919 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 920 | 0 \ |
| 921 | -s "dumping 'expected mac' (20 bytes)" \ |
| 922 | -S "dumping 'expected mac' (10 bytes)" |
| 923 | |
| 924 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 925 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 926 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 927 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 928 | 0 \ |
| 929 | -s "dumping 'expected mac' (20 bytes)" \ |
| 930 | -S "dumping 'expected mac' (10 bytes)" |
| 931 | |
| 932 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 933 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 934 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 935 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 936 | 0 \ |
| 937 | -s "dumping 'expected mac' (20 bytes)" \ |
| 938 | -S "dumping 'expected mac' (10 bytes)" |
| 939 | |
| 940 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 941 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 942 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 943 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 944 | 0 \ |
| 945 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 946 | -s "dumping 'expected mac' (10 bytes)" |
| 947 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 948 | # Tests for Encrypt-then-MAC extension |
| 949 | |
| 950 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 951 | "$P_SRV debug_level=3 \ |
| 952 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 953 | "$P_CLI debug_level=3" \ |
| 954 | 0 \ |
| 955 | -c "client hello, adding encrypt_then_mac extension" \ |
| 956 | -s "found encrypt then mac extension" \ |
| 957 | -s "server hello, adding encrypt then mac extension" \ |
| 958 | -c "found encrypt_then_mac extension" \ |
| 959 | -c "using encrypt then mac" \ |
| 960 | -s "using encrypt then mac" |
| 961 | |
| 962 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 963 | "$P_SRV debug_level=3 etm=0 \ |
| 964 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 965 | "$P_CLI debug_level=3 etm=1" \ |
| 966 | 0 \ |
| 967 | -c "client hello, adding encrypt_then_mac extension" \ |
| 968 | -s "found encrypt then mac extension" \ |
| 969 | -S "server hello, adding encrypt then mac extension" \ |
| 970 | -C "found encrypt_then_mac extension" \ |
| 971 | -C "using encrypt then mac" \ |
| 972 | -S "using encrypt then mac" |
| 973 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 974 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 975 | "$P_SRV debug_level=3 etm=1 \ |
| 976 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 977 | "$P_CLI debug_level=3 etm=1" \ |
| 978 | 0 \ |
| 979 | -c "client hello, adding encrypt_then_mac extension" \ |
| 980 | -s "found encrypt then mac extension" \ |
| 981 | -S "server hello, adding encrypt then mac extension" \ |
| 982 | -C "found encrypt_then_mac extension" \ |
| 983 | -C "using encrypt then mac" \ |
| 984 | -S "using encrypt then mac" |
| 985 | |
| 986 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 987 | "$P_SRV debug_level=3 etm=1 \ |
| 988 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 989 | "$P_CLI debug_level=3 etm=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 990 | 0 \ |
| 991 | -c "client hello, adding encrypt_then_mac extension" \ |
| 992 | -s "found encrypt then mac extension" \ |
| 993 | -S "server hello, adding encrypt then mac extension" \ |
| 994 | -C "found encrypt_then_mac extension" \ |
| 995 | -C "using encrypt then mac" \ |
| 996 | -S "using encrypt then mac" |
| 997 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 998 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 999 | "$P_SRV debug_level=3 etm=1 \ |
| 1000 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1001 | "$P_CLI debug_level=3 etm=0" \ |
| 1002 | 0 \ |
| 1003 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1004 | -S "found encrypt then mac extension" \ |
| 1005 | -S "server hello, adding encrypt then mac extension" \ |
| 1006 | -C "found encrypt_then_mac extension" \ |
| 1007 | -C "using encrypt then mac" \ |
| 1008 | -S "using encrypt then mac" |
| 1009 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1010 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1011 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1012 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1013 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1014 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1015 | 0 \ |
| 1016 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1017 | -S "found encrypt then mac extension" \ |
| 1018 | -S "server hello, adding encrypt then mac extension" \ |
| 1019 | -C "found encrypt_then_mac extension" \ |
| 1020 | -C "using encrypt then mac" \ |
| 1021 | -S "using encrypt then mac" |
| 1022 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1023 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1024 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1025 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1026 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1027 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1028 | 0 \ |
| 1029 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1030 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1031 | -S "server hello, adding encrypt then mac extension" \ |
| 1032 | -C "found encrypt_then_mac extension" \ |
| 1033 | -C "using encrypt then mac" \ |
| 1034 | -S "using encrypt then mac" |
| 1035 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1036 | # Tests for Extended Master Secret extension |
| 1037 | |
| 1038 | run_test "Extended Master Secret: default" \ |
| 1039 | "$P_SRV debug_level=3" \ |
| 1040 | "$P_CLI debug_level=3" \ |
| 1041 | 0 \ |
| 1042 | -c "client hello, adding extended_master_secret extension" \ |
| 1043 | -s "found extended master secret extension" \ |
| 1044 | -s "server hello, adding extended master secret extension" \ |
| 1045 | -c "found extended_master_secret extension" \ |
| 1046 | -c "using extended master secret" \ |
| 1047 | -s "using extended master secret" |
| 1048 | |
| 1049 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1050 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1051 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1052 | 0 \ |
| 1053 | -c "client hello, adding extended_master_secret extension" \ |
| 1054 | -s "found extended master secret extension" \ |
| 1055 | -S "server hello, adding extended master secret extension" \ |
| 1056 | -C "found extended_master_secret extension" \ |
| 1057 | -C "using extended master secret" \ |
| 1058 | -S "using extended master secret" |
| 1059 | |
| 1060 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1061 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1062 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1063 | 0 \ |
| 1064 | -C "client hello, adding extended_master_secret extension" \ |
| 1065 | -S "found extended master secret extension" \ |
| 1066 | -S "server hello, adding extended master secret extension" \ |
| 1067 | -C "found extended_master_secret extension" \ |
| 1068 | -C "using extended master secret" \ |
| 1069 | -S "using extended master secret" |
| 1070 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1071 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1072 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1073 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1074 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1075 | 0 \ |
| 1076 | -C "client hello, adding extended_master_secret extension" \ |
| 1077 | -S "found extended master secret extension" \ |
| 1078 | -S "server hello, adding extended master secret extension" \ |
| 1079 | -C "found extended_master_secret extension" \ |
| 1080 | -C "using extended master secret" \ |
| 1081 | -S "using extended master secret" |
| 1082 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1083 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1084 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1085 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1086 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1087 | 0 \ |
| 1088 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1089 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1090 | -S "server hello, adding extended master secret extension" \ |
| 1091 | -C "found extended_master_secret extension" \ |
| 1092 | -C "using extended master secret" \ |
| 1093 | -S "using extended master secret" |
| 1094 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1095 | # Tests for FALLBACK_SCSV |
| 1096 | |
| 1097 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1098 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1099 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1100 | 0 \ |
| 1101 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1102 | -S "received FALLBACK_SCSV" \ |
| 1103 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1104 | -C "is a fatal alert message (msg 86)" |
| 1105 | |
| 1106 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1107 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1108 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1109 | 0 \ |
| 1110 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1111 | -S "received FALLBACK_SCSV" \ |
| 1112 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1113 | -C "is a fatal alert message (msg 86)" |
| 1114 | |
| 1115 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1116 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1117 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1118 | 1 \ |
| 1119 | -c "adding FALLBACK_SCSV" \ |
| 1120 | -s "received FALLBACK_SCSV" \ |
| 1121 | -s "inapropriate fallback" \ |
| 1122 | -c "is a fatal alert message (msg 86)" |
| 1123 | |
| 1124 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1125 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1126 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1127 | 0 \ |
| 1128 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1129 | -s "received FALLBACK_SCSV" \ |
| 1130 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1131 | -C "is a fatal alert message (msg 86)" |
| 1132 | |
| 1133 | requires_openssl_with_fallback_scsv |
| 1134 | run_test "Fallback SCSV: default, openssl server" \ |
| 1135 | "$O_SRV" \ |
| 1136 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1137 | 0 \ |
| 1138 | -C "adding FALLBACK_SCSV" \ |
| 1139 | -C "is a fatal alert message (msg 86)" |
| 1140 | |
| 1141 | requires_openssl_with_fallback_scsv |
| 1142 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1143 | "$O_SRV" \ |
| 1144 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1145 | 1 \ |
| 1146 | -c "adding FALLBACK_SCSV" \ |
| 1147 | -c "is a fatal alert message (msg 86)" |
| 1148 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1149 | requires_openssl_with_fallback_scsv |
| 1150 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1151 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1152 | "$O_CLI -tls1_1" \ |
| 1153 | 0 \ |
| 1154 | -S "received FALLBACK_SCSV" \ |
| 1155 | -S "inapropriate fallback" |
| 1156 | |
| 1157 | requires_openssl_with_fallback_scsv |
| 1158 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1159 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1160 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1161 | 1 \ |
| 1162 | -s "received FALLBACK_SCSV" \ |
| 1163 | -s "inapropriate fallback" |
| 1164 | |
| 1165 | requires_openssl_with_fallback_scsv |
| 1166 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1167 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1168 | "$O_CLI -fallback_scsv" \ |
| 1169 | 0 \ |
| 1170 | -s "received FALLBACK_SCSV" \ |
| 1171 | -S "inapropriate fallback" |
| 1172 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1173 | # Test sending and receiving empty application data records |
| 1174 | |
| 1175 | run_test "Encrypt then MAC: empty application data record" \ |
| 1176 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1177 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1178 | 0 \ |
| 1179 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1180 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1181 | -c "0 bytes written in 1 fragments" |
| 1182 | |
| 1183 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1184 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1185 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1186 | 0 \ |
| 1187 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1188 | -c "0 bytes written in 1 fragments" |
| 1189 | |
| 1190 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1191 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1192 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1193 | 0 \ |
| 1194 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1195 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1196 | -c "0 bytes written in 1 fragments" |
| 1197 | |
| 1198 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1199 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1200 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1201 | 0 \ |
| 1202 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1203 | -c "0 bytes written in 1 fragments" |
| 1204 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1205 | ## ClientHello generated with |
| 1206 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1207 | ## then manually twiddling the ciphersuite list. |
| 1208 | ## The ClientHello content is spelled out below as a hex string as |
| 1209 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1210 | ## The expected response is an inappropriate_fallback alert. |
| 1211 | requires_openssl_with_fallback_scsv |
| 1212 | run_test "Fallback SCSV: beginning of list" \ |
| 1213 | "$P_SRV debug_level=2" \ |
| 1214 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1215 | 0 \ |
| 1216 | -s "received FALLBACK_SCSV" \ |
| 1217 | -s "inapropriate fallback" |
| 1218 | |
| 1219 | requires_openssl_with_fallback_scsv |
| 1220 | run_test "Fallback SCSV: end of list" \ |
| 1221 | "$P_SRV debug_level=2" \ |
| 1222 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1223 | 0 \ |
| 1224 | -s "received FALLBACK_SCSV" \ |
| 1225 | -s "inapropriate fallback" |
| 1226 | |
| 1227 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1228 | requires_openssl_with_fallback_scsv |
| 1229 | run_test "Fallback SCSV: not in list" \ |
| 1230 | "$P_SRV debug_level=2" \ |
| 1231 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1232 | 0 \ |
| 1233 | -S "received FALLBACK_SCSV" \ |
| 1234 | -S "inapropriate fallback" |
| 1235 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1236 | # Tests for CBC 1/n-1 record splitting |
| 1237 | |
| 1238 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1239 | "$P_SRV" \ |
| 1240 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1241 | request_size=123 force_version=tls1_2" \ |
| 1242 | 0 \ |
| 1243 | -s "Read from client: 123 bytes read" \ |
| 1244 | -S "Read from client: 1 bytes read" \ |
| 1245 | -S "122 bytes read" |
| 1246 | |
| 1247 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1248 | "$P_SRV" \ |
| 1249 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1250 | request_size=123 force_version=tls1_1" \ |
| 1251 | 0 \ |
| 1252 | -s "Read from client: 123 bytes read" \ |
| 1253 | -S "Read from client: 1 bytes read" \ |
| 1254 | -S "122 bytes read" |
| 1255 | |
| 1256 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1257 | "$P_SRV" \ |
| 1258 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1259 | request_size=123 force_version=tls1" \ |
| 1260 | 0 \ |
| 1261 | -S "Read from client: 123 bytes read" \ |
| 1262 | -s "Read from client: 1 bytes read" \ |
| 1263 | -s "122 bytes read" |
| 1264 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1265 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1266 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1267 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1268 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1269 | request_size=123 force_version=ssl3" \ |
| 1270 | 0 \ |
| 1271 | -S "Read from client: 123 bytes read" \ |
| 1272 | -s "Read from client: 1 bytes read" \ |
| 1273 | -s "122 bytes read" |
| 1274 | |
| 1275 | run_test "CBC Record splitting: TLS 1.0 RC4, no splitting" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1276 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1277 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1278 | request_size=123 force_version=tls1" \ |
| 1279 | 0 \ |
| 1280 | -s "Read from client: 123 bytes read" \ |
| 1281 | -S "Read from client: 1 bytes read" \ |
| 1282 | -S "122 bytes read" |
| 1283 | |
| 1284 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1285 | "$P_SRV" \ |
| 1286 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1287 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1288 | 0 \ |
| 1289 | -s "Read from client: 123 bytes read" \ |
| 1290 | -S "Read from client: 1 bytes read" \ |
| 1291 | -S "122 bytes read" |
| 1292 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1293 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1294 | "$P_SRV nbio=2" \ |
| 1295 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1296 | request_size=123 force_version=tls1" \ |
| 1297 | 0 \ |
| 1298 | -S "Read from client: 123 bytes read" \ |
| 1299 | -s "Read from client: 1 bytes read" \ |
| 1300 | -s "122 bytes read" |
| 1301 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1302 | # Tests for Session Tickets |
| 1303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1304 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1305 | "$P_SRV debug_level=3 tickets=1" \ |
| 1306 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1307 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1308 | -c "client hello, adding session ticket extension" \ |
| 1309 | -s "found session ticket extension" \ |
| 1310 | -s "server hello, adding session ticket extension" \ |
| 1311 | -c "found session_ticket extension" \ |
| 1312 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1313 | -S "session successfully restored from cache" \ |
| 1314 | -s "session successfully restored from ticket" \ |
| 1315 | -s "a session has been resumed" \ |
| 1316 | -c "a session has been resumed" |
| 1317 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1318 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1319 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1320 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1321 | 0 \ |
| 1322 | -c "client hello, adding session ticket extension" \ |
| 1323 | -s "found session ticket extension" \ |
| 1324 | -s "server hello, adding session ticket extension" \ |
| 1325 | -c "found session_ticket extension" \ |
| 1326 | -c "parse new session ticket" \ |
| 1327 | -S "session successfully restored from cache" \ |
| 1328 | -s "session successfully restored from ticket" \ |
| 1329 | -s "a session has been resumed" \ |
| 1330 | -c "a session has been resumed" |
| 1331 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1332 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1333 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1334 | "$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] | 1335 | 0 \ |
| 1336 | -c "client hello, adding session ticket extension" \ |
| 1337 | -s "found session ticket extension" \ |
| 1338 | -s "server hello, adding session ticket extension" \ |
| 1339 | -c "found session_ticket extension" \ |
| 1340 | -c "parse new session ticket" \ |
| 1341 | -S "session successfully restored from cache" \ |
| 1342 | -S "session successfully restored from ticket" \ |
| 1343 | -S "a session has been resumed" \ |
| 1344 | -C "a session has been resumed" |
| 1345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1346 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1347 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1348 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1349 | 0 \ |
| 1350 | -c "client hello, adding session ticket extension" \ |
| 1351 | -c "found session_ticket extension" \ |
| 1352 | -c "parse new session ticket" \ |
| 1353 | -c "a session has been resumed" |
| 1354 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1355 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1356 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1357 | "( $O_CLI -sess_out $SESSION; \ |
| 1358 | $O_CLI -sess_in $SESSION; \ |
| 1359 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1360 | 0 \ |
| 1361 | -s "found session ticket extension" \ |
| 1362 | -s "server hello, adding session ticket extension" \ |
| 1363 | -S "session successfully restored from cache" \ |
| 1364 | -s "session successfully restored from ticket" \ |
| 1365 | -s "a session has been resumed" |
| 1366 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1367 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1369 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1370 | "$P_SRV debug_level=3 tickets=0" \ |
| 1371 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1372 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1373 | -c "client hello, adding session ticket extension" \ |
| 1374 | -s "found session ticket extension" \ |
| 1375 | -S "server hello, adding session ticket extension" \ |
| 1376 | -C "found session_ticket extension" \ |
| 1377 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1378 | -s "session successfully restored from cache" \ |
| 1379 | -S "session successfully restored from ticket" \ |
| 1380 | -s "a session has been resumed" \ |
| 1381 | -c "a session has been resumed" |
| 1382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1383 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1384 | "$P_SRV debug_level=3 tickets=1" \ |
| 1385 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1386 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1387 | -C "client hello, adding session ticket extension" \ |
| 1388 | -S "found session ticket extension" \ |
| 1389 | -S "server hello, adding session ticket extension" \ |
| 1390 | -C "found session_ticket extension" \ |
| 1391 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1392 | -s "session successfully restored from cache" \ |
| 1393 | -S "session successfully restored from ticket" \ |
| 1394 | -s "a session has been resumed" \ |
| 1395 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1396 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1397 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1398 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1399 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1400 | 0 \ |
| 1401 | -S "session successfully restored from cache" \ |
| 1402 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1403 | -S "a session has been resumed" \ |
| 1404 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1406 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1407 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1408 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1409 | 0 \ |
| 1410 | -s "session successfully restored from cache" \ |
| 1411 | -S "session successfully restored from ticket" \ |
| 1412 | -s "a session has been resumed" \ |
| 1413 | -c "a session has been resumed" |
| 1414 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1415 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1416 | "$P_SRV debug_level=3 tickets=0" \ |
| 1417 | "$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] | 1418 | 0 \ |
| 1419 | -s "session successfully restored from cache" \ |
| 1420 | -S "session successfully restored from ticket" \ |
| 1421 | -s "a session has been resumed" \ |
| 1422 | -c "a session has been resumed" |
| 1423 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1424 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1425 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1426 | "$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] | 1427 | 0 \ |
| 1428 | -S "session successfully restored from cache" \ |
| 1429 | -S "session successfully restored from ticket" \ |
| 1430 | -S "a session has been resumed" \ |
| 1431 | -C "a session has been resumed" |
| 1432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1433 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1434 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1435 | "$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] | 1436 | 0 \ |
| 1437 | -s "session successfully restored from cache" \ |
| 1438 | -S "session successfully restored from ticket" \ |
| 1439 | -s "a session has been resumed" \ |
| 1440 | -c "a session has been resumed" |
| 1441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1442 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1443 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1444 | "( $O_CLI -sess_out $SESSION; \ |
| 1445 | $O_CLI -sess_in $SESSION; \ |
| 1446 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1447 | 0 \ |
| 1448 | -s "found session ticket extension" \ |
| 1449 | -S "server hello, adding session ticket extension" \ |
| 1450 | -s "session successfully restored from cache" \ |
| 1451 | -S "session successfully restored from ticket" \ |
| 1452 | -s "a session has been resumed" |
| 1453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1454 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1455 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1456 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1457 | 0 \ |
| 1458 | -C "found session_ticket extension" \ |
| 1459 | -C "parse new session ticket" \ |
| 1460 | -c "a session has been resumed" |
| 1461 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1462 | # Tests for Max Fragment Length extension |
| 1463 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1464 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1465 | printf "${CONFIG_H} defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 1466 | exit 1 |
| 1467 | fi |
| 1468 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1469 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1470 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1471 | fi |
| 1472 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1473 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1474 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1475 | "$P_SRV debug_level=3" \ |
| 1476 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1477 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1478 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1479 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1480 | -C "client hello, adding max_fragment_length extension" \ |
| 1481 | -S "found max fragment length extension" \ |
| 1482 | -S "server hello, max_fragment_length extension" \ |
| 1483 | -C "found max_fragment_length extension" |
| 1484 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1485 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1486 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1487 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1488 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1489 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1490 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1491 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1492 | -C "client hello, adding max_fragment_length extension" \ |
| 1493 | -S "found max fragment length extension" \ |
| 1494 | -S "server hello, max_fragment_length extension" \ |
| 1495 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1496 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1497 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1498 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1499 | |
| 1500 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1501 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1502 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1503 | "$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] | 1504 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1505 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1506 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1507 | -C "client hello, adding max_fragment_length extension" \ |
| 1508 | -S "found max fragment length extension" \ |
| 1509 | -S "server hello, max_fragment_length extension" \ |
| 1510 | -C "found max_fragment_length extension" \ |
| 1511 | -c "fragment larger than.*maximum " |
| 1512 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1513 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1514 | # (session fragment length will be 16384 regardless of mbedtls |
| 1515 | # content length configuration.) |
| 1516 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1517 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1518 | run_test "Max fragment length: disabled, larger message" \ |
| 1519 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1520 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1521 | 0 \ |
| 1522 | -C "Maximum fragment length is 16384" \ |
| 1523 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1524 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1525 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1526 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1527 | |
| 1528 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1529 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1530 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1531 | "$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] | 1532 | 1 \ |
| 1533 | -C "Maximum fragment length is 16384" \ |
| 1534 | -S "Maximum fragment length is 16384" \ |
| 1535 | -c "fragment larger than.*maximum " |
| 1536 | |
| 1537 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1538 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1539 | "$P_SRV debug_level=3" \ |
| 1540 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1541 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1542 | -c "Maximum fragment length is 4096" \ |
| 1543 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1544 | -c "client hello, adding max_fragment_length extension" \ |
| 1545 | -s "found max fragment length extension" \ |
| 1546 | -s "server hello, max_fragment_length extension" \ |
| 1547 | -c "found max_fragment_length extension" |
| 1548 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1549 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1550 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1551 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1552 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1553 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1554 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1555 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1556 | -C "client hello, adding max_fragment_length extension" \ |
| 1557 | -S "found max fragment length extension" \ |
| 1558 | -S "server hello, max_fragment_length extension" \ |
| 1559 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1560 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1561 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1562 | requires_gnutls |
| 1563 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1564 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1565 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1566 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1567 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1568 | -c "client hello, adding max_fragment_length extension" \ |
| 1569 | -c "found max_fragment_length extension" |
| 1570 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1571 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1572 | run_test "Max fragment length: client, message just fits" \ |
| 1573 | "$P_SRV debug_level=3" \ |
| 1574 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1575 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1576 | -c "Maximum fragment length is 2048" \ |
| 1577 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1578 | -c "client hello, adding max_fragment_length extension" \ |
| 1579 | -s "found max fragment length extension" \ |
| 1580 | -s "server hello, max_fragment_length extension" \ |
| 1581 | -c "found max_fragment_length extension" \ |
| 1582 | -c "2048 bytes written in 1 fragments" \ |
| 1583 | -s "2048 bytes read" |
| 1584 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1585 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1586 | run_test "Max fragment length: client, larger message" \ |
| 1587 | "$P_SRV debug_level=3" \ |
| 1588 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1589 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1590 | -c "Maximum fragment length is 2048" \ |
| 1591 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1592 | -c "client hello, adding max_fragment_length extension" \ |
| 1593 | -s "found max fragment length extension" \ |
| 1594 | -s "server hello, max_fragment_length extension" \ |
| 1595 | -c "found max_fragment_length extension" \ |
| 1596 | -c "2345 bytes written in 2 fragments" \ |
| 1597 | -s "2048 bytes read" \ |
| 1598 | -s "297 bytes read" |
| 1599 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1601 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1602 | "$P_SRV debug_level=3 dtls=1" \ |
| 1603 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1604 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1605 | -c "Maximum fragment length is 2048" \ |
| 1606 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1607 | -c "client hello, adding max_fragment_length extension" \ |
| 1608 | -s "found max fragment length extension" \ |
| 1609 | -s "server hello, max_fragment_length extension" \ |
| 1610 | -c "found max_fragment_length extension" \ |
| 1611 | -c "fragment larger than.*maximum" |
| 1612 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1613 | # Tests for renegotiation |
| 1614 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1615 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1616 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1617 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1618 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1619 | 0 \ |
| 1620 | -C "client hello, adding renegotiation extension" \ |
| 1621 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1622 | -S "found renegotiation extension" \ |
| 1623 | -s "server hello, secure renegotiation extension" \ |
| 1624 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1625 | -C "=> renegotiate" \ |
| 1626 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1627 | -S "write hello request" |
| 1628 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1630 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1631 | "$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] | 1632 | "$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] | 1633 | 0 \ |
| 1634 | -c "client hello, adding renegotiation extension" \ |
| 1635 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1636 | -s "found renegotiation extension" \ |
| 1637 | -s "server hello, secure renegotiation extension" \ |
| 1638 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1639 | -c "=> renegotiate" \ |
| 1640 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1641 | -S "write hello request" |
| 1642 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1643 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1644 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1645 | "$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] | 1646 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1647 | 0 \ |
| 1648 | -c "client hello, adding renegotiation extension" \ |
| 1649 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1650 | -s "found renegotiation extension" \ |
| 1651 | -s "server hello, secure renegotiation extension" \ |
| 1652 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1653 | -c "=> renegotiate" \ |
| 1654 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1655 | -s "write hello request" |
| 1656 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1657 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1658 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1659 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1660 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1661 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1662 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1663 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1664 | 0 \ |
| 1665 | -c "client hello, adding renegotiation extension" \ |
| 1666 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1667 | -s "found renegotiation extension" \ |
| 1668 | -s "server hello, secure renegotiation extension" \ |
| 1669 | -c "found renegotiation extension" \ |
| 1670 | -c "=> renegotiate" \ |
| 1671 | -s "=> renegotiate" \ |
| 1672 | -S "write hello request" \ |
| 1673 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1674 | |
| 1675 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1676 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1677 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1678 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1679 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1680 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1681 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1682 | 0 \ |
| 1683 | -c "client hello, adding renegotiation extension" \ |
| 1684 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1685 | -s "found renegotiation extension" \ |
| 1686 | -s "server hello, secure renegotiation extension" \ |
| 1687 | -c "found renegotiation extension" \ |
| 1688 | -c "=> renegotiate" \ |
| 1689 | -s "=> renegotiate" \ |
| 1690 | -s "write hello request" \ |
| 1691 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1692 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1693 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1694 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1695 | "$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] | 1696 | "$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] | 1697 | 0 \ |
| 1698 | -c "client hello, adding renegotiation extension" \ |
| 1699 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1700 | -s "found renegotiation extension" \ |
| 1701 | -s "server hello, secure renegotiation extension" \ |
| 1702 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1703 | -c "=> renegotiate" \ |
| 1704 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1705 | -s "write hello request" |
| 1706 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1707 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1708 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1709 | "$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] | 1710 | "$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] | 1711 | 1 \ |
| 1712 | -c "client hello, adding renegotiation extension" \ |
| 1713 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1714 | -S "found renegotiation extension" \ |
| 1715 | -s "server hello, secure renegotiation extension" \ |
| 1716 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1717 | -c "=> renegotiate" \ |
| 1718 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1719 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1720 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1721 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1722 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1724 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1725 | "$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] | 1726 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1727 | 0 \ |
| 1728 | -C "client hello, adding renegotiation extension" \ |
| 1729 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1730 | -S "found renegotiation extension" \ |
| 1731 | -s "server hello, secure renegotiation extension" \ |
| 1732 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1733 | -C "=> renegotiate" \ |
| 1734 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1735 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1736 | -S "SSL - An unexpected message was received from our peer" \ |
| 1737 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1738 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1740 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1741 | "$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] | 1742 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1743 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1744 | 0 \ |
| 1745 | -C "client hello, adding renegotiation extension" \ |
| 1746 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1747 | -S "found renegotiation extension" \ |
| 1748 | -s "server hello, secure renegotiation extension" \ |
| 1749 | -c "found renegotiation extension" \ |
| 1750 | -C "=> renegotiate" \ |
| 1751 | -S "=> renegotiate" \ |
| 1752 | -s "write hello request" \ |
| 1753 | -S "SSL - An unexpected message was received from our peer" \ |
| 1754 | -S "failed" |
| 1755 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1756 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1757 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1758 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1759 | "$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] | 1760 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1761 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1762 | 0 \ |
| 1763 | -C "client hello, adding renegotiation extension" \ |
| 1764 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1765 | -S "found renegotiation extension" \ |
| 1766 | -s "server hello, secure renegotiation extension" \ |
| 1767 | -c "found renegotiation extension" \ |
| 1768 | -C "=> renegotiate" \ |
| 1769 | -S "=> renegotiate" \ |
| 1770 | -s "write hello request" \ |
| 1771 | -S "SSL - An unexpected message was received from our peer" \ |
| 1772 | -S "failed" |
| 1773 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1774 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1775 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1776 | "$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] | 1777 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1778 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1779 | 0 \ |
| 1780 | -C "client hello, adding renegotiation extension" \ |
| 1781 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1782 | -S "found renegotiation extension" \ |
| 1783 | -s "server hello, secure renegotiation extension" \ |
| 1784 | -c "found renegotiation extension" \ |
| 1785 | -C "=> renegotiate" \ |
| 1786 | -S "=> renegotiate" \ |
| 1787 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1788 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1789 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1790 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1791 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1792 | "$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] | 1793 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1794 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1795 | 0 \ |
| 1796 | -c "client hello, adding renegotiation extension" \ |
| 1797 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1798 | -s "found renegotiation extension" \ |
| 1799 | -s "server hello, secure renegotiation extension" \ |
| 1800 | -c "found renegotiation extension" \ |
| 1801 | -c "=> renegotiate" \ |
| 1802 | -s "=> renegotiate" \ |
| 1803 | -s "write hello request" \ |
| 1804 | -S "SSL - An unexpected message was received from our peer" \ |
| 1805 | -S "failed" |
| 1806 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1807 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1808 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1809 | "$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] | 1810 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1811 | 0 \ |
| 1812 | -C "client hello, adding renegotiation extension" \ |
| 1813 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1814 | -S "found renegotiation extension" \ |
| 1815 | -s "server hello, secure renegotiation extension" \ |
| 1816 | -c "found renegotiation extension" \ |
| 1817 | -S "record counter limit reached: renegotiate" \ |
| 1818 | -C "=> renegotiate" \ |
| 1819 | -S "=> renegotiate" \ |
| 1820 | -S "write hello request" \ |
| 1821 | -S "SSL - An unexpected message was received from our peer" \ |
| 1822 | -S "failed" |
| 1823 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1824 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1825 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1826 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1827 | "$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] | 1828 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1829 | 0 \ |
| 1830 | -c "client hello, adding renegotiation extension" \ |
| 1831 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1832 | -s "found renegotiation extension" \ |
| 1833 | -s "server hello, secure renegotiation extension" \ |
| 1834 | -c "found renegotiation extension" \ |
| 1835 | -s "record counter limit reached: renegotiate" \ |
| 1836 | -c "=> renegotiate" \ |
| 1837 | -s "=> renegotiate" \ |
| 1838 | -s "write hello request" \ |
| 1839 | -S "SSL - An unexpected message was received from our peer" \ |
| 1840 | -S "failed" |
| 1841 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1842 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1843 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1844 | "$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] | 1845 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1846 | 0 \ |
| 1847 | -c "client hello, adding renegotiation extension" \ |
| 1848 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1849 | -s "found renegotiation extension" \ |
| 1850 | -s "server hello, secure renegotiation extension" \ |
| 1851 | -c "found renegotiation extension" \ |
| 1852 | -s "record counter limit reached: renegotiate" \ |
| 1853 | -c "=> renegotiate" \ |
| 1854 | -s "=> renegotiate" \ |
| 1855 | -s "write hello request" \ |
| 1856 | -S "SSL - An unexpected message was received from our peer" \ |
| 1857 | -S "failed" |
| 1858 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1860 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1861 | "$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] | 1862 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1863 | 0 \ |
| 1864 | -C "client hello, adding renegotiation extension" \ |
| 1865 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1866 | -S "found renegotiation extension" \ |
| 1867 | -s "server hello, secure renegotiation extension" \ |
| 1868 | -c "found renegotiation extension" \ |
| 1869 | -S "record counter limit reached: renegotiate" \ |
| 1870 | -C "=> renegotiate" \ |
| 1871 | -S "=> renegotiate" \ |
| 1872 | -S "write hello request" \ |
| 1873 | -S "SSL - An unexpected message was received from our peer" \ |
| 1874 | -S "failed" |
| 1875 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1876 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1877 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1878 | "$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] | 1879 | "$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] | 1880 | 0 \ |
| 1881 | -c "client hello, adding renegotiation extension" \ |
| 1882 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1883 | -s "found renegotiation extension" \ |
| 1884 | -s "server hello, secure renegotiation extension" \ |
| 1885 | -c "found renegotiation extension" \ |
| 1886 | -c "=> renegotiate" \ |
| 1887 | -s "=> renegotiate" \ |
| 1888 | -S "write hello request" |
| 1889 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1891 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1892 | "$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] | 1893 | "$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] | 1894 | 0 \ |
| 1895 | -c "client hello, adding renegotiation extension" \ |
| 1896 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1897 | -s "found renegotiation extension" \ |
| 1898 | -s "server hello, secure renegotiation extension" \ |
| 1899 | -c "found renegotiation extension" \ |
| 1900 | -c "=> renegotiate" \ |
| 1901 | -s "=> renegotiate" \ |
| 1902 | -s "write hello request" |
| 1903 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1905 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1906 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1907 | "$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] | 1908 | 0 \ |
| 1909 | -c "client hello, adding renegotiation extension" \ |
| 1910 | -c "found renegotiation extension" \ |
| 1911 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1912 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1913 | -C "error" \ |
| 1914 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1915 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1916 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1917 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1918 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1919 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1920 | "$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] | 1921 | 0 \ |
| 1922 | -c "client hello, adding renegotiation extension" \ |
| 1923 | -c "found renegotiation extension" \ |
| 1924 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1925 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1926 | -C "error" \ |
| 1927 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1928 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1929 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1931 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1932 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1933 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1934 | 1 \ |
| 1935 | -c "client hello, adding renegotiation extension" \ |
| 1936 | -C "found renegotiation extension" \ |
| 1937 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1938 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1939 | -c "error" \ |
| 1940 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1941 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1942 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1944 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1945 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1946 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1947 | allow_legacy=0" \ |
| 1948 | 1 \ |
| 1949 | -c "client hello, adding renegotiation extension" \ |
| 1950 | -C "found renegotiation extension" \ |
| 1951 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1952 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1953 | -c "error" \ |
| 1954 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1955 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1956 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1958 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1959 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1960 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1961 | allow_legacy=1" \ |
| 1962 | 0 \ |
| 1963 | -c "client hello, adding renegotiation extension" \ |
| 1964 | -C "found renegotiation extension" \ |
| 1965 | -c "=> renegotiate" \ |
| 1966 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1967 | -C "error" \ |
| 1968 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1969 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1971 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1972 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1974 | 0 \ |
| 1975 | -c "client hello, adding renegotiation extension" \ |
| 1976 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1977 | -s "found renegotiation extension" \ |
| 1978 | -s "server hello, secure renegotiation extension" \ |
| 1979 | -c "found renegotiation extension" \ |
| 1980 | -c "=> renegotiate" \ |
| 1981 | -s "=> renegotiate" \ |
| 1982 | -S "write hello request" |
| 1983 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1985 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1986 | "$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] | 1987 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1988 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1989 | 0 \ |
| 1990 | -c "client hello, adding renegotiation extension" \ |
| 1991 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1992 | -s "found renegotiation extension" \ |
| 1993 | -s "server hello, secure renegotiation extension" \ |
| 1994 | -c "found renegotiation extension" \ |
| 1995 | -c "=> renegotiate" \ |
| 1996 | -s "=> renegotiate" \ |
| 1997 | -s "write hello request" |
| 1998 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2000 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2001 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2002 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2003 | 0 \ |
| 2004 | -c "client hello, adding renegotiation extension" \ |
| 2005 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2006 | -s "found renegotiation extension" \ |
| 2007 | -s "server hello, secure renegotiation extension" \ |
| 2008 | -s "record counter limit reached: renegotiate" \ |
| 2009 | -c "=> renegotiate" \ |
| 2010 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2011 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2012 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2013 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2015 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2016 | "$G_SRV -u --mtu 4096" \ |
| 2017 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2018 | 0 \ |
| 2019 | -c "client hello, adding renegotiation extension" \ |
| 2020 | -c "found renegotiation extension" \ |
| 2021 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2022 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2023 | -C "error" \ |
| 2024 | -s "Extra-header:" |
| 2025 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2026 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2027 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2028 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2029 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2030 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2031 | "$P_CLI debug_level=3" \ |
| 2032 | 0 \ |
| 2033 | -c "found renegotiation extension" \ |
| 2034 | -C "error" \ |
| 2035 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2036 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2037 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2038 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2039 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2040 | "$P_CLI debug_level=3" \ |
| 2041 | 0 \ |
| 2042 | -C "found renegotiation extension" \ |
| 2043 | -C "error" \ |
| 2044 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2045 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2046 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2047 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2048 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2049 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2050 | 1 \ |
| 2051 | -C "found renegotiation extension" \ |
| 2052 | -c "error" \ |
| 2053 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2054 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2055 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2056 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2057 | "$P_SRV debug_level=3" \ |
| 2058 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2059 | 0 \ |
| 2060 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2061 | -s "server hello, secure renegotiation extension" |
| 2062 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2063 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2064 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2065 | "$P_SRV debug_level=3" \ |
| 2066 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2067 | 0 \ |
| 2068 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2069 | -S "server hello, secure renegotiation extension" |
| 2070 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2071 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2072 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2073 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 2074 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2075 | 1 \ |
| 2076 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2077 | -S "server hello, secure renegotiation extension" |
| 2078 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2079 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2080 | |
| 2081 | requires_gnutls |
| 2082 | run_test "DER format: no trailing bytes" \ |
| 2083 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2084 | key_file=data_files/server5.key" \ |
| 2085 | "$G_CLI " \ |
| 2086 | 0 \ |
| 2087 | -c "Handshake was completed" \ |
| 2088 | |
| 2089 | requires_gnutls |
| 2090 | run_test "DER format: with a trailing zero byte" \ |
| 2091 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2092 | key_file=data_files/server5.key" \ |
| 2093 | "$G_CLI " \ |
| 2094 | 0 \ |
| 2095 | -c "Handshake was completed" \ |
| 2096 | |
| 2097 | requires_gnutls |
| 2098 | run_test "DER format: with a trailing random byte" \ |
| 2099 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2100 | key_file=data_files/server5.key" \ |
| 2101 | "$G_CLI " \ |
| 2102 | 0 \ |
| 2103 | -c "Handshake was completed" \ |
| 2104 | |
| 2105 | requires_gnutls |
| 2106 | run_test "DER format: with 2 trailing random bytes" \ |
| 2107 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2108 | key_file=data_files/server5.key" \ |
| 2109 | "$G_CLI " \ |
| 2110 | 0 \ |
| 2111 | -c "Handshake was completed" \ |
| 2112 | |
| 2113 | requires_gnutls |
| 2114 | run_test "DER format: with 4 trailing random bytes" \ |
| 2115 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2116 | key_file=data_files/server5.key" \ |
| 2117 | "$G_CLI " \ |
| 2118 | 0 \ |
| 2119 | -c "Handshake was completed" \ |
| 2120 | |
| 2121 | requires_gnutls |
| 2122 | run_test "DER format: with 8 trailing random bytes" \ |
| 2123 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2124 | key_file=data_files/server5.key" \ |
| 2125 | "$G_CLI " \ |
| 2126 | 0 \ |
| 2127 | -c "Handshake was completed" \ |
| 2128 | |
| 2129 | requires_gnutls |
| 2130 | run_test "DER format: with 9 trailing random bytes" \ |
| 2131 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2132 | key_file=data_files/server5.key" \ |
| 2133 | "$G_CLI " \ |
| 2134 | 0 \ |
| 2135 | -c "Handshake was completed" \ |
| 2136 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2137 | # Tests for auth_mode |
| 2138 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2139 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2140 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2141 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2142 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2143 | 1 \ |
| 2144 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2145 | -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] | 2146 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2147 | -c "X509 - Certificate verification failed" |
| 2148 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2149 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2150 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2151 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2152 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2153 | 0 \ |
| 2154 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2155 | -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] | 2156 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2157 | -C "X509 - Certificate verification failed" |
| 2158 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2159 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2160 | "$P_SRV" \ |
| 2161 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2162 | 0 \ |
| 2163 | -c "x509_verify_cert() returned" \ |
| 2164 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2165 | -c "! Certificate verification flags"\ |
| 2166 | -C "! mbedtls_ssl_handshake returned" \ |
| 2167 | -C "X509 - Certificate verification failed" \ |
| 2168 | -C "SSL - No CA Chain is set, but required to operate" |
| 2169 | |
| 2170 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2171 | "$P_SRV" \ |
| 2172 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2173 | 1 \ |
| 2174 | -c "x509_verify_cert() returned" \ |
| 2175 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2176 | -c "! Certificate verification flags"\ |
| 2177 | -c "! mbedtls_ssl_handshake returned" \ |
| 2178 | -c "SSL - No CA Chain is set, but required to operate" |
| 2179 | |
| 2180 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2181 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2182 | # the client informs the server about the supported curves - it does, though, in the |
| 2183 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2184 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2185 | # different means to have the server ignoring the client's supported curve list. |
| 2186 | |
| 2187 | requires_config_enabled MBEDTLS_ECP_C |
| 2188 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2189 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2190 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2191 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2192 | 1 \ |
| 2193 | -c "bad certificate (EC key curve)"\ |
| 2194 | -c "! Certificate verification flags"\ |
| 2195 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2196 | |
| 2197 | requires_config_enabled MBEDTLS_ECP_C |
| 2198 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2199 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2200 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2201 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2202 | 1 \ |
| 2203 | -c "bad certificate (EC key curve)"\ |
| 2204 | -c "! Certificate verification flags"\ |
| 2205 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2207 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2208 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2209 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2210 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2211 | 0 \ |
| 2212 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2213 | -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] | 2214 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2215 | -C "X509 - Certificate verification failed" |
| 2216 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2217 | run_test "Authentication: client SHA256, server required" \ |
| 2218 | "$P_SRV auth_mode=required" \ |
| 2219 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2220 | key_file=data_files/server6.key \ |
| 2221 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2222 | 0 \ |
| 2223 | -c "Supported Signature Algorithm found: 4," \ |
| 2224 | -c "Supported Signature Algorithm found: 5," |
| 2225 | |
| 2226 | run_test "Authentication: client SHA384, server required" \ |
| 2227 | "$P_SRV auth_mode=required" \ |
| 2228 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2229 | key_file=data_files/server6.key \ |
| 2230 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2231 | 0 \ |
| 2232 | -c "Supported Signature Algorithm found: 4," \ |
| 2233 | -c "Supported Signature Algorithm found: 5," |
| 2234 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2236 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2237 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2238 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2239 | key_file=data_files/server5.key" \ |
| 2240 | 1 \ |
| 2241 | -S "skip write certificate request" \ |
| 2242 | -C "skip parse certificate request" \ |
| 2243 | -c "got a certificate request" \ |
| 2244 | -c "got no certificate to send" \ |
| 2245 | -S "x509_verify_cert() returned" \ |
| 2246 | -s "client has no certificate" \ |
| 2247 | -s "! mbedtls_ssl_handshake returned" \ |
| 2248 | -c "! mbedtls_ssl_handshake returned" \ |
| 2249 | -s "No client certification received from the client, but required by the authentication mode" |
| 2250 | |
| 2251 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2252 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2253 | "$P_CLI debug_level=3 crt_file=none \ |
| 2254 | key_file=data_files/server5.key" \ |
| 2255 | 1 \ |
| 2256 | -S "skip write certificate request" \ |
| 2257 | -C "skip parse certificate request" \ |
| 2258 | -c "got a certificate request" \ |
| 2259 | -c "= write certificate$" \ |
| 2260 | -C "skip write certificate$" \ |
| 2261 | -S "x509_verify_cert() returned" \ |
| 2262 | -s "client has no certificate" \ |
| 2263 | -s "! mbedtls_ssl_handshake returned" \ |
| 2264 | -c "! mbedtls_ssl_handshake returned" \ |
| 2265 | -s "No client certification received from the client, but required by the authentication mode" |
| 2266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2267 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2268 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2269 | "$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] | 2270 | key_file=data_files/server5.key" \ |
| 2271 | 1 \ |
| 2272 | -S "skip write certificate request" \ |
| 2273 | -C "skip parse certificate request" \ |
| 2274 | -c "got a certificate request" \ |
| 2275 | -C "skip write certificate" \ |
| 2276 | -C "skip write certificate verify" \ |
| 2277 | -S "skip parse certificate verify" \ |
| 2278 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2279 | -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] | 2280 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2281 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2282 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2283 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2284 | # We don't check that the client receives the alert because it might |
| 2285 | # detect that its write end of the connection is closed and abort |
| 2286 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2287 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2288 | run_test "Authentication: client cert not trusted, server required" \ |
| 2289 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2290 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2291 | key_file=data_files/server5.key" \ |
| 2292 | 1 \ |
| 2293 | -S "skip write certificate request" \ |
| 2294 | -C "skip parse certificate request" \ |
| 2295 | -c "got a certificate request" \ |
| 2296 | -C "skip write certificate" \ |
| 2297 | -C "skip write certificate verify" \ |
| 2298 | -S "skip parse certificate verify" \ |
| 2299 | -s "x509_verify_cert() returned" \ |
| 2300 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2301 | -s "! mbedtls_ssl_handshake returned" \ |
| 2302 | -c "! mbedtls_ssl_handshake returned" \ |
| 2303 | -s "X509 - Certificate verification failed" |
| 2304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2305 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2306 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2307 | "$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] | 2308 | key_file=data_files/server5.key" \ |
| 2309 | 0 \ |
| 2310 | -S "skip write certificate request" \ |
| 2311 | -C "skip parse certificate request" \ |
| 2312 | -c "got a certificate request" \ |
| 2313 | -C "skip write certificate" \ |
| 2314 | -C "skip write certificate verify" \ |
| 2315 | -S "skip parse certificate verify" \ |
| 2316 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2317 | -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] | 2318 | -S "! mbedtls_ssl_handshake returned" \ |
| 2319 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2320 | -S "X509 - Certificate verification failed" |
| 2321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2322 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2323 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2324 | "$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] | 2325 | key_file=data_files/server5.key" \ |
| 2326 | 0 \ |
| 2327 | -s "skip write certificate request" \ |
| 2328 | -C "skip parse certificate request" \ |
| 2329 | -c "got no certificate request" \ |
| 2330 | -c "skip write certificate" \ |
| 2331 | -c "skip write certificate verify" \ |
| 2332 | -s "skip parse certificate verify" \ |
| 2333 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2334 | -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] | 2335 | -S "! mbedtls_ssl_handshake returned" \ |
| 2336 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2337 | -S "X509 - Certificate verification failed" |
| 2338 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2339 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2340 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2341 | "$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] | 2342 | 0 \ |
| 2343 | -S "skip write certificate request" \ |
| 2344 | -C "skip parse certificate request" \ |
| 2345 | -c "got a certificate request" \ |
| 2346 | -C "skip write certificate$" \ |
| 2347 | -C "got no certificate to send" \ |
| 2348 | -S "SSLv3 client has no certificate" \ |
| 2349 | -c "skip write certificate verify" \ |
| 2350 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2351 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2352 | -S "! mbedtls_ssl_handshake returned" \ |
| 2353 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2354 | -S "X509 - Certificate verification failed" |
| 2355 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2356 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2357 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2358 | "$O_CLI" \ |
| 2359 | 0 \ |
| 2360 | -S "skip write certificate request" \ |
| 2361 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2362 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2363 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2364 | -S "X509 - Certificate verification failed" |
| 2365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2366 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2367 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2368 | "$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] | 2369 | 0 \ |
| 2370 | -C "skip parse certificate request" \ |
| 2371 | -c "got a certificate request" \ |
| 2372 | -C "skip write certificate$" \ |
| 2373 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2374 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2375 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2376 | run_test "Authentication: client no cert, openssl server required" \ |
| 2377 | "$O_SRV -Verify 10" \ |
| 2378 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2379 | 1 \ |
| 2380 | -C "skip parse certificate request" \ |
| 2381 | -c "got a certificate request" \ |
| 2382 | -C "skip write certificate$" \ |
| 2383 | -c "skip write certificate verify" \ |
| 2384 | -c "! mbedtls_ssl_handshake returned" |
| 2385 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2387 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2388 | "$P_SRV debug_level=3 auth_mode=optional force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 2389 | "$P_CLI debug_level=3 crt_file=none key_file=none min_version=ssl3" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2390 | 0 \ |
| 2391 | -S "skip write certificate request" \ |
| 2392 | -C "skip parse certificate request" \ |
| 2393 | -c "got a certificate request" \ |
| 2394 | -C "skip write certificate$" \ |
| 2395 | -c "skip write certificate verify" \ |
| 2396 | -c "got no certificate to send" \ |
| 2397 | -s "SSLv3 client has no certificate" \ |
| 2398 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2399 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2400 | -S "! mbedtls_ssl_handshake returned" \ |
| 2401 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2402 | -S "X509 - Certificate verification failed" |
| 2403 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2404 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2405 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2406 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2407 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2408 | MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2409 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2410 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2411 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2412 | printf "MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script’s\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2413 | printf "test value of ${MAX_IM_CA}. \n" |
| 2414 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2415 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2416 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2417 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2418 | |
| 2419 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2420 | fi |
| 2421 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2422 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2423 | run_test "Authentication: server max_int chain, client default" \ |
| 2424 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2425 | key_file=data_files/dir-maxpath/09.key" \ |
| 2426 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2427 | 0 \ |
| 2428 | -C "X509 - A fatal error occured" |
| 2429 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2430 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2431 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2432 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2433 | key_file=data_files/dir-maxpath/10.key" \ |
| 2434 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2435 | 1 \ |
| 2436 | -c "X509 - A fatal error occured" |
| 2437 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2438 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2439 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2440 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2441 | key_file=data_files/dir-maxpath/10.key" \ |
| 2442 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2443 | auth_mode=optional" \ |
| 2444 | 1 \ |
| 2445 | -c "X509 - A fatal error occured" |
| 2446 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2447 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2448 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2449 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2450 | key_file=data_files/dir-maxpath/10.key" \ |
| 2451 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2452 | auth_mode=none" \ |
| 2453 | 0 \ |
| 2454 | -C "X509 - A fatal error occured" |
| 2455 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2456 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2457 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2458 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2459 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2460 | key_file=data_files/dir-maxpath/10.key" \ |
| 2461 | 0 \ |
| 2462 | -S "X509 - A fatal error occured" |
| 2463 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2464 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2465 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2466 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2467 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2468 | key_file=data_files/dir-maxpath/10.key" \ |
| 2469 | 1 \ |
| 2470 | -s "X509 - A fatal error occured" |
| 2471 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2472 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2473 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2474 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2475 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2476 | key_file=data_files/dir-maxpath/10.key" \ |
| 2477 | 1 \ |
| 2478 | -s "X509 - A fatal error occured" |
| 2479 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2480 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2481 | run_test "Authentication: client max_int chain, server required" \ |
| 2482 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2483 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2484 | key_file=data_files/dir-maxpath/09.key" \ |
| 2485 | 0 \ |
| 2486 | -S "X509 - A fatal error occured" |
| 2487 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2488 | # Tests for CA list in CertificateRequest messages |
| 2489 | |
| 2490 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2491 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2492 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2493 | key_file=data_files/server6.key" \ |
| 2494 | 0 \ |
| 2495 | -s "requested DN" |
| 2496 | |
| 2497 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2498 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2499 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2500 | key_file=data_files/server6.key" \ |
| 2501 | 0 \ |
| 2502 | -S "requested DN" |
| 2503 | |
| 2504 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2505 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2506 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2507 | key_file=data_files/server5.key" \ |
| 2508 | 1 \ |
| 2509 | -S "requested DN" \ |
| 2510 | -s "x509_verify_cert() returned" \ |
| 2511 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2512 | -s "! mbedtls_ssl_handshake returned" \ |
| 2513 | -c "! mbedtls_ssl_handshake returned" \ |
| 2514 | -s "X509 - Certificate verification failed" |
| 2515 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2516 | # Tests for certificate selection based on SHA verson |
| 2517 | |
| 2518 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2519 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2520 | key_file=data_files/server5.key \ |
| 2521 | crt_file2=data_files/server5-sha1.crt \ |
| 2522 | key_file2=data_files/server5.key" \ |
| 2523 | "$P_CLI force_version=tls1_2" \ |
| 2524 | 0 \ |
| 2525 | -c "signed using.*ECDSA with SHA256" \ |
| 2526 | -C "signed using.*ECDSA with SHA1" |
| 2527 | |
| 2528 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2529 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2530 | key_file=data_files/server5.key \ |
| 2531 | crt_file2=data_files/server5-sha1.crt \ |
| 2532 | key_file2=data_files/server5.key" \ |
| 2533 | "$P_CLI force_version=tls1_1" \ |
| 2534 | 0 \ |
| 2535 | -C "signed using.*ECDSA with SHA256" \ |
| 2536 | -c "signed using.*ECDSA with SHA1" |
| 2537 | |
| 2538 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2539 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2540 | key_file=data_files/server5.key \ |
| 2541 | crt_file2=data_files/server5-sha1.crt \ |
| 2542 | key_file2=data_files/server5.key" \ |
| 2543 | "$P_CLI force_version=tls1" \ |
| 2544 | 0 \ |
| 2545 | -C "signed using.*ECDSA with SHA256" \ |
| 2546 | -c "signed using.*ECDSA with SHA1" |
| 2547 | |
| 2548 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2549 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2550 | key_file=data_files/server5.key \ |
| 2551 | crt_file2=data_files/server6.crt \ |
| 2552 | key_file2=data_files/server6.key" \ |
| 2553 | "$P_CLI force_version=tls1_1" \ |
| 2554 | 0 \ |
| 2555 | -c "serial number.*09" \ |
| 2556 | -c "signed using.*ECDSA with SHA256" \ |
| 2557 | -C "signed using.*ECDSA with SHA1" |
| 2558 | |
| 2559 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2560 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2561 | key_file=data_files/server6.key \ |
| 2562 | crt_file2=data_files/server5.crt \ |
| 2563 | key_file2=data_files/server5.key" \ |
| 2564 | "$P_CLI force_version=tls1_1" \ |
| 2565 | 0 \ |
| 2566 | -c "serial number.*0A" \ |
| 2567 | -c "signed using.*ECDSA with SHA256" \ |
| 2568 | -C "signed using.*ECDSA with SHA1" |
| 2569 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2570 | # tests for SNI |
| 2571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2572 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2573 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2574 | 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] | 2575 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2576 | 0 \ |
| 2577 | -S "parse ServerName extension" \ |
| 2578 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2579 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2581 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2582 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2583 | 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] | 2584 | 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] | 2585 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2586 | 0 \ |
| 2587 | -s "parse ServerName extension" \ |
| 2588 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2589 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2591 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2592 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2593 | 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] | 2594 | 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] | 2595 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2596 | 0 \ |
| 2597 | -s "parse ServerName extension" \ |
| 2598 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2599 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2601 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2602 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2603 | 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] | 2604 | 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] | 2605 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2606 | 1 \ |
| 2607 | -s "parse ServerName extension" \ |
| 2608 | -s "ssl_sni_wrapper() returned" \ |
| 2609 | -s "mbedtls_ssl_handshake returned" \ |
| 2610 | -c "mbedtls_ssl_handshake returned" \ |
| 2611 | -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] | 2612 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2613 | run_test "SNI: client auth no override: optional" \ |
| 2614 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2615 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2616 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2617 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2618 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2619 | -S "skip write certificate request" \ |
| 2620 | -C "skip parse certificate request" \ |
| 2621 | -c "got a certificate request" \ |
| 2622 | -C "skip write certificate" \ |
| 2623 | -C "skip write certificate verify" \ |
| 2624 | -S "skip parse certificate verify" |
| 2625 | |
| 2626 | run_test "SNI: client auth override: none -> optional" \ |
| 2627 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2628 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2629 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2630 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2631 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2632 | -S "skip write certificate request" \ |
| 2633 | -C "skip parse certificate request" \ |
| 2634 | -c "got a certificate request" \ |
| 2635 | -C "skip write certificate" \ |
| 2636 | -C "skip write certificate verify" \ |
| 2637 | -S "skip parse certificate verify" |
| 2638 | |
| 2639 | run_test "SNI: client auth override: optional -> none" \ |
| 2640 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2641 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2642 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2643 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2644 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2645 | -s "skip write certificate request" \ |
| 2646 | -C "skip parse certificate request" \ |
| 2647 | -c "got no certificate request" \ |
| 2648 | -c "skip write certificate" \ |
| 2649 | -c "skip write certificate verify" \ |
| 2650 | -s "skip parse certificate verify" |
| 2651 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2652 | run_test "SNI: CA no override" \ |
| 2653 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2654 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2655 | ca_file=data_files/test-ca.crt \ |
| 2656 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2657 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2658 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2659 | 1 \ |
| 2660 | -S "skip write certificate request" \ |
| 2661 | -C "skip parse certificate request" \ |
| 2662 | -c "got a certificate request" \ |
| 2663 | -C "skip write certificate" \ |
| 2664 | -C "skip write certificate verify" \ |
| 2665 | -S "skip parse certificate verify" \ |
| 2666 | -s "x509_verify_cert() returned" \ |
| 2667 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2668 | -S "The certificate has been revoked (is on a CRL)" |
| 2669 | |
| 2670 | run_test "SNI: CA override" \ |
| 2671 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2672 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2673 | ca_file=data_files/test-ca.crt \ |
| 2674 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2675 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2676 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2677 | 0 \ |
| 2678 | -S "skip write certificate request" \ |
| 2679 | -C "skip parse certificate request" \ |
| 2680 | -c "got a certificate request" \ |
| 2681 | -C "skip write certificate" \ |
| 2682 | -C "skip write certificate verify" \ |
| 2683 | -S "skip parse certificate verify" \ |
| 2684 | -S "x509_verify_cert() returned" \ |
| 2685 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2686 | -S "The certificate has been revoked (is on a CRL)" |
| 2687 | |
| 2688 | run_test "SNI: CA override with CRL" \ |
| 2689 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2690 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2691 | ca_file=data_files/test-ca.crt \ |
| 2692 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2693 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2694 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2695 | 1 \ |
| 2696 | -S "skip write certificate request" \ |
| 2697 | -C "skip parse certificate request" \ |
| 2698 | -c "got a certificate request" \ |
| 2699 | -C "skip write certificate" \ |
| 2700 | -C "skip write certificate verify" \ |
| 2701 | -S "skip parse certificate verify" \ |
| 2702 | -s "x509_verify_cert() returned" \ |
| 2703 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2704 | -s "The certificate has been revoked (is on a CRL)" |
| 2705 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2706 | # Tests for SNI and DTLS |
| 2707 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2708 | run_test "SNI: DTLS, no SNI callback" \ |
| 2709 | "$P_SRV debug_level=3 dtls=1 \ |
| 2710 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2711 | "$P_CLI server_name=localhost dtls=1" \ |
| 2712 | 0 \ |
| 2713 | -S "parse ServerName extension" \ |
| 2714 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2715 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2716 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2717 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2718 | "$P_SRV debug_level=3 dtls=1 \ |
| 2719 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2720 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2721 | "$P_CLI server_name=localhost dtls=1" \ |
| 2722 | 0 \ |
| 2723 | -s "parse ServerName extension" \ |
| 2724 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2725 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2726 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2727 | run_test "SNI: DTLS, matching cert 2" \ |
| 2728 | "$P_SRV debug_level=3 dtls=1 \ |
| 2729 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2730 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2731 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2732 | 0 \ |
| 2733 | -s "parse ServerName extension" \ |
| 2734 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2735 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2736 | |
| 2737 | run_test "SNI: DTLS, no matching cert" \ |
| 2738 | "$P_SRV debug_level=3 dtls=1 \ |
| 2739 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2740 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2741 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2742 | 1 \ |
| 2743 | -s "parse ServerName extension" \ |
| 2744 | -s "ssl_sni_wrapper() returned" \ |
| 2745 | -s "mbedtls_ssl_handshake returned" \ |
| 2746 | -c "mbedtls_ssl_handshake returned" \ |
| 2747 | -c "SSL - A fatal alert message was received from our peer" |
| 2748 | |
| 2749 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2750 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2751 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2752 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2753 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2754 | 0 \ |
| 2755 | -S "skip write certificate request" \ |
| 2756 | -C "skip parse certificate request" \ |
| 2757 | -c "got a certificate request" \ |
| 2758 | -C "skip write certificate" \ |
| 2759 | -C "skip write certificate verify" \ |
| 2760 | -S "skip parse certificate verify" |
| 2761 | |
| 2762 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2763 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2764 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2765 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2766 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2767 | 0 \ |
| 2768 | -S "skip write certificate request" \ |
| 2769 | -C "skip parse certificate request" \ |
| 2770 | -c "got a certificate request" \ |
| 2771 | -C "skip write certificate" \ |
| 2772 | -C "skip write certificate verify" \ |
| 2773 | -S "skip parse certificate verify" |
| 2774 | |
| 2775 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2776 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2777 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2778 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2779 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2780 | 0 \ |
| 2781 | -s "skip write certificate request" \ |
| 2782 | -C "skip parse certificate request" \ |
| 2783 | -c "got no certificate request" \ |
| 2784 | -c "skip write certificate" \ |
| 2785 | -c "skip write certificate verify" \ |
| 2786 | -s "skip parse certificate verify" |
| 2787 | |
| 2788 | run_test "SNI: DTLS, CA no override" \ |
| 2789 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2790 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2791 | ca_file=data_files/test-ca.crt \ |
| 2792 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2793 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2794 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2795 | 1 \ |
| 2796 | -S "skip write certificate request" \ |
| 2797 | -C "skip parse certificate request" \ |
| 2798 | -c "got a certificate request" \ |
| 2799 | -C "skip write certificate" \ |
| 2800 | -C "skip write certificate verify" \ |
| 2801 | -S "skip parse certificate verify" \ |
| 2802 | -s "x509_verify_cert() returned" \ |
| 2803 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2804 | -S "The certificate has been revoked (is on a CRL)" |
| 2805 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2806 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2807 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2808 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2809 | ca_file=data_files/test-ca.crt \ |
| 2810 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2811 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2812 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2813 | 0 \ |
| 2814 | -S "skip write certificate request" \ |
| 2815 | -C "skip parse certificate request" \ |
| 2816 | -c "got a certificate request" \ |
| 2817 | -C "skip write certificate" \ |
| 2818 | -C "skip write certificate verify" \ |
| 2819 | -S "skip parse certificate verify" \ |
| 2820 | -S "x509_verify_cert() returned" \ |
| 2821 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2822 | -S "The certificate has been revoked (is on a CRL)" |
| 2823 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2824 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2826 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2827 | ca_file=data_files/test-ca.crt \ |
| 2828 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2829 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2830 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2831 | 1 \ |
| 2832 | -S "skip write certificate request" \ |
| 2833 | -C "skip parse certificate request" \ |
| 2834 | -c "got a certificate request" \ |
| 2835 | -C "skip write certificate" \ |
| 2836 | -C "skip write certificate verify" \ |
| 2837 | -S "skip parse certificate verify" \ |
| 2838 | -s "x509_verify_cert() returned" \ |
| 2839 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2840 | -s "The certificate has been revoked (is on a CRL)" |
| 2841 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2842 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2844 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2845 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2846 | "$P_CLI nbio=2 tickets=0" \ |
| 2847 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2848 | -S "mbedtls_ssl_handshake returned" \ |
| 2849 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2850 | -c "Read from server: .* bytes read" |
| 2851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2852 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2853 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2854 | "$P_CLI nbio=2 tickets=0" \ |
| 2855 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2856 | -S "mbedtls_ssl_handshake returned" \ |
| 2857 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2858 | -c "Read from server: .* bytes read" |
| 2859 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2860 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2861 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2862 | "$P_CLI nbio=2 tickets=1" \ |
| 2863 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2864 | -S "mbedtls_ssl_handshake returned" \ |
| 2865 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2866 | -c "Read from server: .* bytes read" |
| 2867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2868 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2869 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2870 | "$P_CLI nbio=2 tickets=1" \ |
| 2871 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2872 | -S "mbedtls_ssl_handshake returned" \ |
| 2873 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2874 | -c "Read from server: .* bytes read" |
| 2875 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2876 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2877 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2878 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2879 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2880 | -S "mbedtls_ssl_handshake returned" \ |
| 2881 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2882 | -c "Read from server: .* bytes read" |
| 2883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2884 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2885 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2886 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2887 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2888 | -S "mbedtls_ssl_handshake returned" \ |
| 2889 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2890 | -c "Read from server: .* bytes read" |
| 2891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2892 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2893 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2894 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 2895 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2896 | -S "mbedtls_ssl_handshake returned" \ |
| 2897 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2898 | -c "Read from server: .* bytes read" |
| 2899 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 2900 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 2901 | |
| 2902 | run_test "Event-driven I/O: basic handshake" \ |
| 2903 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2904 | "$P_CLI event=1 tickets=0" \ |
| 2905 | 0 \ |
| 2906 | -S "mbedtls_ssl_handshake returned" \ |
| 2907 | -C "mbedtls_ssl_handshake returned" \ |
| 2908 | -c "Read from server: .* bytes read" |
| 2909 | |
| 2910 | run_test "Event-driven I/O: client auth" \ |
| 2911 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 2912 | "$P_CLI event=1 tickets=0" \ |
| 2913 | 0 \ |
| 2914 | -S "mbedtls_ssl_handshake returned" \ |
| 2915 | -C "mbedtls_ssl_handshake returned" \ |
| 2916 | -c "Read from server: .* bytes read" |
| 2917 | |
| 2918 | run_test "Event-driven I/O: ticket" \ |
| 2919 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2920 | "$P_CLI event=1 tickets=1" \ |
| 2921 | 0 \ |
| 2922 | -S "mbedtls_ssl_handshake returned" \ |
| 2923 | -C "mbedtls_ssl_handshake returned" \ |
| 2924 | -c "Read from server: .* bytes read" |
| 2925 | |
| 2926 | run_test "Event-driven I/O: ticket + client auth" \ |
| 2927 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2928 | "$P_CLI event=1 tickets=1" \ |
| 2929 | 0 \ |
| 2930 | -S "mbedtls_ssl_handshake returned" \ |
| 2931 | -C "mbedtls_ssl_handshake returned" \ |
| 2932 | -c "Read from server: .* bytes read" |
| 2933 | |
| 2934 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 2935 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2936 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2937 | 0 \ |
| 2938 | -S "mbedtls_ssl_handshake returned" \ |
| 2939 | -C "mbedtls_ssl_handshake returned" \ |
| 2940 | -c "Read from server: .* bytes read" |
| 2941 | |
| 2942 | run_test "Event-driven I/O: ticket + resume" \ |
| 2943 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2944 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2945 | 0 \ |
| 2946 | -S "mbedtls_ssl_handshake returned" \ |
| 2947 | -C "mbedtls_ssl_handshake returned" \ |
| 2948 | -c "Read from server: .* bytes read" |
| 2949 | |
| 2950 | run_test "Event-driven I/O: session-id resume" \ |
| 2951 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2952 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 2953 | 0 \ |
| 2954 | -S "mbedtls_ssl_handshake returned" \ |
| 2955 | -C "mbedtls_ssl_handshake returned" \ |
| 2956 | -c "Read from server: .* bytes read" |
| 2957 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 2958 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 2959 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2960 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2961 | 0 \ |
| 2962 | -c "Read from server: .* bytes read" |
| 2963 | |
| 2964 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 2965 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 2966 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2967 | 0 \ |
| 2968 | -c "Read from server: .* bytes read" |
| 2969 | |
| 2970 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 2971 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2972 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2973 | 0 \ |
| 2974 | -c "Read from server: .* bytes read" |
| 2975 | |
| 2976 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 2977 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2978 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2979 | 0 \ |
| 2980 | -c "Read from server: .* bytes read" |
| 2981 | |
| 2982 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 2983 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2984 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2985 | 0 \ |
| 2986 | -c "Read from server: .* bytes read" |
| 2987 | |
| 2988 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 2989 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2990 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2991 | 0 \ |
| 2992 | -c "Read from server: .* bytes read" |
| 2993 | |
| 2994 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 2995 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2996 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 2997 | 0 \ |
| 2998 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 2999 | |
| 3000 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3001 | # During session resumption, the client will send its ApplicationData record |
| 3002 | # within the same datagram as the Finished messages. In this situation, the |
| 3003 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3004 | # because the ApplicationData request has already been queued internally. |
| 3005 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3006 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3007 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3008 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3009 | 0 \ |
| 3010 | -c "Read from server: .* bytes read" |
| 3011 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3012 | # Tests for version negotiation |
| 3013 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3014 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3015 | "$P_SRV" \ |
| 3016 | "$P_CLI" \ |
| 3017 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3018 | -S "mbedtls_ssl_handshake returned" \ |
| 3019 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3020 | -s "Protocol is TLSv1.2" \ |
| 3021 | -c "Protocol is TLSv1.2" |
| 3022 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3023 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3024 | "$P_SRV" \ |
| 3025 | "$P_CLI max_version=tls1_1" \ |
| 3026 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3027 | -S "mbedtls_ssl_handshake returned" \ |
| 3028 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3029 | -s "Protocol is TLSv1.1" \ |
| 3030 | -c "Protocol is TLSv1.1" |
| 3031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3032 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3033 | "$P_SRV max_version=tls1_1" \ |
| 3034 | "$P_CLI" \ |
| 3035 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3036 | -S "mbedtls_ssl_handshake returned" \ |
| 3037 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3038 | -s "Protocol is TLSv1.1" \ |
| 3039 | -c "Protocol is TLSv1.1" |
| 3040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3041 | run_test "Version check: cli+srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3042 | "$P_SRV max_version=tls1_1" \ |
| 3043 | "$P_CLI max_version=tls1_1" \ |
| 3044 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3045 | -S "mbedtls_ssl_handshake returned" \ |
| 3046 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3047 | -s "Protocol is TLSv1.1" \ |
| 3048 | -c "Protocol is TLSv1.1" |
| 3049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3050 | run_test "Version check: cli max 1.1, srv min 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3051 | "$P_SRV min_version=tls1_1" \ |
| 3052 | "$P_CLI max_version=tls1_1" \ |
| 3053 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3054 | -S "mbedtls_ssl_handshake returned" \ |
| 3055 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3056 | -s "Protocol is TLSv1.1" \ |
| 3057 | -c "Protocol is TLSv1.1" |
| 3058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3059 | run_test "Version check: cli min 1.1, srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3060 | "$P_SRV max_version=tls1_1" \ |
| 3061 | "$P_CLI min_version=tls1_1" \ |
| 3062 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3063 | -S "mbedtls_ssl_handshake returned" \ |
| 3064 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3065 | -s "Protocol is TLSv1.1" \ |
| 3066 | -c "Protocol is TLSv1.1" |
| 3067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3068 | run_test "Version check: cli min 1.2, srv max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3069 | "$P_SRV max_version=tls1_1" \ |
| 3070 | "$P_CLI min_version=tls1_2" \ |
| 3071 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3072 | -s "mbedtls_ssl_handshake returned" \ |
| 3073 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3074 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3076 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3077 | "$P_SRV min_version=tls1_2" \ |
| 3078 | "$P_CLI max_version=tls1_1" \ |
| 3079 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3080 | -s "mbedtls_ssl_handshake returned" \ |
| 3081 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3082 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3083 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3084 | # Tests for ALPN extension |
| 3085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3086 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3087 | "$P_SRV debug_level=3" \ |
| 3088 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3089 | 0 \ |
| 3090 | -C "client hello, adding alpn extension" \ |
| 3091 | -S "found alpn extension" \ |
| 3092 | -C "got an alert message, type: \\[2:120]" \ |
| 3093 | -S "server hello, adding alpn extension" \ |
| 3094 | -C "found alpn extension " \ |
| 3095 | -C "Application Layer Protocol is" \ |
| 3096 | -S "Application Layer Protocol is" |
| 3097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3098 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3099 | "$P_SRV debug_level=3" \ |
| 3100 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3101 | 0 \ |
| 3102 | -c "client hello, adding alpn extension" \ |
| 3103 | -s "found alpn extension" \ |
| 3104 | -C "got an alert message, type: \\[2:120]" \ |
| 3105 | -S "server hello, adding alpn extension" \ |
| 3106 | -C "found alpn extension " \ |
| 3107 | -c "Application Layer Protocol is (none)" \ |
| 3108 | -S "Application Layer Protocol is" |
| 3109 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3110 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3111 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3112 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3113 | 0 \ |
| 3114 | -C "client hello, adding alpn extension" \ |
| 3115 | -S "found alpn extension" \ |
| 3116 | -C "got an alert message, type: \\[2:120]" \ |
| 3117 | -S "server hello, adding alpn extension" \ |
| 3118 | -C "found alpn extension " \ |
| 3119 | -C "Application Layer Protocol is" \ |
| 3120 | -s "Application Layer Protocol is (none)" |
| 3121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3122 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3123 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3124 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3125 | 0 \ |
| 3126 | -c "client hello, adding alpn extension" \ |
| 3127 | -s "found alpn extension" \ |
| 3128 | -C "got an alert message, type: \\[2:120]" \ |
| 3129 | -s "server hello, adding alpn extension" \ |
| 3130 | -c "found alpn extension" \ |
| 3131 | -c "Application Layer Protocol is abc" \ |
| 3132 | -s "Application Layer Protocol is abc" |
| 3133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3135 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3136 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3137 | 0 \ |
| 3138 | -c "client hello, adding alpn extension" \ |
| 3139 | -s "found alpn extension" \ |
| 3140 | -C "got an alert message, type: \\[2:120]" \ |
| 3141 | -s "server hello, adding alpn extension" \ |
| 3142 | -c "found alpn extension" \ |
| 3143 | -c "Application Layer Protocol is abc" \ |
| 3144 | -s "Application Layer Protocol is abc" |
| 3145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3146 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3147 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3148 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3149 | 0 \ |
| 3150 | -c "client hello, adding alpn extension" \ |
| 3151 | -s "found alpn extension" \ |
| 3152 | -C "got an alert message, type: \\[2:120]" \ |
| 3153 | -s "server hello, adding alpn extension" \ |
| 3154 | -c "found alpn extension" \ |
| 3155 | -c "Application Layer Protocol is 1234" \ |
| 3156 | -s "Application Layer Protocol is 1234" |
| 3157 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3158 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3159 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3160 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3161 | 1 \ |
| 3162 | -c "client hello, adding alpn extension" \ |
| 3163 | -s "found alpn extension" \ |
| 3164 | -c "got an alert message, type: \\[2:120]" \ |
| 3165 | -S "server hello, adding alpn extension" \ |
| 3166 | -C "found alpn extension" \ |
| 3167 | -C "Application Layer Protocol is 1234" \ |
| 3168 | -S "Application Layer Protocol is 1234" |
| 3169 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3170 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3171 | # Tests for keyUsage in leaf certificates, part 1: |
| 3172 | # server-side certificate/suite selection |
| 3173 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3174 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3175 | "$P_SRV key_file=data_files/server2.key \ |
| 3176 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3177 | "$P_CLI" \ |
| 3178 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3179 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3180 | |
| 3181 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3182 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3183 | "$P_SRV key_file=data_files/server2.key \ |
| 3184 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3185 | "$P_CLI" \ |
| 3186 | 0 \ |
| 3187 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3188 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3189 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3190 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3191 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3192 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3193 | 1 \ |
| 3194 | -C "Ciphersuite is " |
| 3195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3196 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3197 | "$P_SRV key_file=data_files/server5.key \ |
| 3198 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3199 | "$P_CLI" \ |
| 3200 | 0 \ |
| 3201 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3202 | |
| 3203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3204 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3205 | "$P_SRV key_file=data_files/server5.key \ |
| 3206 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3207 | "$P_CLI" \ |
| 3208 | 0 \ |
| 3209 | -c "Ciphersuite is TLS-ECDH-" |
| 3210 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3211 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3212 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3213 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3214 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3215 | 1 \ |
| 3216 | -C "Ciphersuite is " |
| 3217 | |
| 3218 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3219 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3220 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3221 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3222 | "$O_SRV -key data_files/server2.key \ |
| 3223 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3224 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3225 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3226 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3227 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3228 | -C "Processing of the Certificate handshake message failed" \ |
| 3229 | -c "Ciphersuite is TLS-" |
| 3230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3231 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3232 | "$O_SRV -key data_files/server2.key \ |
| 3233 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3234 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3235 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3236 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3237 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3238 | -C "Processing of the Certificate handshake message failed" \ |
| 3239 | -c "Ciphersuite is TLS-" |
| 3240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3241 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3242 | "$O_SRV -key data_files/server2.key \ |
| 3243 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3244 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3245 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3246 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3247 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3248 | -C "Processing of the Certificate handshake message failed" \ |
| 3249 | -c "Ciphersuite is TLS-" |
| 3250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3251 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3252 | "$O_SRV -key data_files/server2.key \ |
| 3253 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3254 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3255 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3256 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3257 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3258 | -c "Processing of the Certificate handshake message failed" \ |
| 3259 | -C "Ciphersuite is TLS-" |
| 3260 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3261 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3262 | "$O_SRV -key data_files/server2.key \ |
| 3263 | -cert data_files/server2.ku-ke.crt" \ |
| 3264 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3265 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3266 | 0 \ |
| 3267 | -c "bad certificate (usage extensions)" \ |
| 3268 | -C "Processing of the Certificate handshake message failed" \ |
| 3269 | -c "Ciphersuite is TLS-" \ |
| 3270 | -c "! Usage does not match the keyUsage extension" |
| 3271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3272 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3273 | "$O_SRV -key data_files/server2.key \ |
| 3274 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3275 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3276 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3277 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3278 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3279 | -C "Processing of the Certificate handshake message failed" \ |
| 3280 | -c "Ciphersuite is TLS-" |
| 3281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3282 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3283 | "$O_SRV -key data_files/server2.key \ |
| 3284 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3285 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3286 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3287 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3288 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3289 | -c "Processing of the Certificate handshake message failed" \ |
| 3290 | -C "Ciphersuite is TLS-" |
| 3291 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3292 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3293 | "$O_SRV -key data_files/server2.key \ |
| 3294 | -cert data_files/server2.ku-ds.crt" \ |
| 3295 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3296 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3297 | 0 \ |
| 3298 | -c "bad certificate (usage extensions)" \ |
| 3299 | -C "Processing of the Certificate handshake message failed" \ |
| 3300 | -c "Ciphersuite is TLS-" \ |
| 3301 | -c "! Usage does not match the keyUsage extension" |
| 3302 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3303 | # Tests for keyUsage in leaf certificates, part 3: |
| 3304 | # server-side checking of client cert |
| 3305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3306 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3307 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3308 | "$O_CLI -key data_files/server2.key \ |
| 3309 | -cert data_files/server2.ku-ds.crt" \ |
| 3310 | 0 \ |
| 3311 | -S "bad certificate (usage extensions)" \ |
| 3312 | -S "Processing of the Certificate handshake message failed" |
| 3313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3314 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3315 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3316 | "$O_CLI -key data_files/server2.key \ |
| 3317 | -cert data_files/server2.ku-ke.crt" \ |
| 3318 | 0 \ |
| 3319 | -s "bad certificate (usage extensions)" \ |
| 3320 | -S "Processing of the Certificate handshake message failed" |
| 3321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3322 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3323 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3324 | "$O_CLI -key data_files/server2.key \ |
| 3325 | -cert data_files/server2.ku-ke.crt" \ |
| 3326 | 1 \ |
| 3327 | -s "bad certificate (usage extensions)" \ |
| 3328 | -s "Processing of the Certificate handshake message failed" |
| 3329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3330 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3331 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3332 | "$O_CLI -key data_files/server5.key \ |
| 3333 | -cert data_files/server5.ku-ds.crt" \ |
| 3334 | 0 \ |
| 3335 | -S "bad certificate (usage extensions)" \ |
| 3336 | -S "Processing of the Certificate handshake message failed" |
| 3337 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3338 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3339 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3340 | "$O_CLI -key data_files/server5.key \ |
| 3341 | -cert data_files/server5.ku-ka.crt" \ |
| 3342 | 0 \ |
| 3343 | -s "bad certificate (usage extensions)" \ |
| 3344 | -S "Processing of the Certificate handshake message failed" |
| 3345 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3346 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3347 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3348 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3349 | "$P_SRV key_file=data_files/server5.key \ |
| 3350 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3351 | "$P_CLI" \ |
| 3352 | 0 |
| 3353 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3354 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3355 | "$P_SRV key_file=data_files/server5.key \ |
| 3356 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3357 | "$P_CLI" \ |
| 3358 | 0 |
| 3359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3360 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3361 | "$P_SRV key_file=data_files/server5.key \ |
| 3362 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3363 | "$P_CLI" \ |
| 3364 | 0 |
| 3365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3366 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3367 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3368 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3369 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3370 | 1 |
| 3371 | |
| 3372 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3374 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3375 | "$O_SRV -key data_files/server5.key \ |
| 3376 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3377 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3378 | 0 \ |
| 3379 | -C "bad certificate (usage extensions)" \ |
| 3380 | -C "Processing of the Certificate handshake message failed" \ |
| 3381 | -c "Ciphersuite is TLS-" |
| 3382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3383 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3384 | "$O_SRV -key data_files/server5.key \ |
| 3385 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3386 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3387 | 0 \ |
| 3388 | -C "bad certificate (usage extensions)" \ |
| 3389 | -C "Processing of the Certificate handshake message failed" \ |
| 3390 | -c "Ciphersuite is TLS-" |
| 3391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3392 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3393 | "$O_SRV -key data_files/server5.key \ |
| 3394 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3395 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3396 | 0 \ |
| 3397 | -C "bad certificate (usage extensions)" \ |
| 3398 | -C "Processing of the Certificate handshake message failed" \ |
| 3399 | -c "Ciphersuite is TLS-" |
| 3400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3401 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3402 | "$O_SRV -key data_files/server5.key \ |
| 3403 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3404 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3405 | 1 \ |
| 3406 | -c "bad certificate (usage extensions)" \ |
| 3407 | -c "Processing of the Certificate handshake message failed" \ |
| 3408 | -C "Ciphersuite is TLS-" |
| 3409 | |
| 3410 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3411 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3412 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3413 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3414 | "$O_CLI -key data_files/server5.key \ |
| 3415 | -cert data_files/server5.eku-cli.crt" \ |
| 3416 | 0 \ |
| 3417 | -S "bad certificate (usage extensions)" \ |
| 3418 | -S "Processing of the Certificate handshake message failed" |
| 3419 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3420 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3421 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3422 | "$O_CLI -key data_files/server5.key \ |
| 3423 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3424 | 0 \ |
| 3425 | -S "bad certificate (usage extensions)" \ |
| 3426 | -S "Processing of the Certificate handshake message failed" |
| 3427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3428 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3429 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3430 | "$O_CLI -key data_files/server5.key \ |
| 3431 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3432 | 0 \ |
| 3433 | -S "bad certificate (usage extensions)" \ |
| 3434 | -S "Processing of the Certificate handshake message failed" |
| 3435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3436 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3437 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3438 | "$O_CLI -key data_files/server5.key \ |
| 3439 | -cert data_files/server5.eku-cs.crt" \ |
| 3440 | 0 \ |
| 3441 | -s "bad certificate (usage extensions)" \ |
| 3442 | -S "Processing of the Certificate handshake message failed" |
| 3443 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3444 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3445 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3446 | "$O_CLI -key data_files/server5.key \ |
| 3447 | -cert data_files/server5.eku-cs.crt" \ |
| 3448 | 1 \ |
| 3449 | -s "bad certificate (usage extensions)" \ |
| 3450 | -s "Processing of the Certificate handshake message failed" |
| 3451 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3452 | # Tests for DHM parameters loading |
| 3453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3454 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3455 | "$P_SRV" \ |
| 3456 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3457 | debug_level=3" \ |
| 3458 | 0 \ |
| 3459 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3460 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3461 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3462 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3463 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3464 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3465 | debug_level=3" \ |
| 3466 | 0 \ |
| 3467 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3468 | -c "value of 'DHM: G ' (2 bits)" |
| 3469 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3470 | # Tests for DHM client-side size checking |
| 3471 | |
| 3472 | run_test "DHM size: server default, client default, OK" \ |
| 3473 | "$P_SRV" \ |
| 3474 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3475 | debug_level=1" \ |
| 3476 | 0 \ |
| 3477 | -C "DHM prime too short:" |
| 3478 | |
| 3479 | run_test "DHM size: server default, client 2048, OK" \ |
| 3480 | "$P_SRV" \ |
| 3481 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3482 | debug_level=1 dhmlen=2048" \ |
| 3483 | 0 \ |
| 3484 | -C "DHM prime too short:" |
| 3485 | |
| 3486 | run_test "DHM size: server 1024, client default, OK" \ |
| 3487 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3488 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3489 | debug_level=1" \ |
| 3490 | 0 \ |
| 3491 | -C "DHM prime too short:" |
| 3492 | |
| 3493 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3494 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3495 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3496 | debug_level=1" \ |
| 3497 | 1 \ |
| 3498 | -c "DHM prime too short:" |
| 3499 | |
| 3500 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3501 | "$P_SRV" \ |
| 3502 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3503 | debug_level=1 dhmlen=2049" \ |
| 3504 | 1 \ |
| 3505 | -c "DHM prime too short:" |
| 3506 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3507 | # Tests for PSK callback |
| 3508 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3509 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3510 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3511 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3512 | psk_identity=foo psk=abc123" \ |
| 3513 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3514 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3515 | -S "SSL - Unknown identity received" \ |
| 3516 | -S "SSL - Verification of the message MAC failed" |
| 3517 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3518 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3519 | "$P_SRV" \ |
| 3520 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3521 | psk_identity=foo psk=abc123" \ |
| 3522 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3523 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3524 | -S "SSL - Unknown identity received" \ |
| 3525 | -S "SSL - Verification of the message MAC failed" |
| 3526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3527 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3528 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3529 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3530 | psk_identity=foo psk=abc123" \ |
| 3531 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3532 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3533 | -s "SSL - Unknown identity received" \ |
| 3534 | -S "SSL - Verification of the message MAC failed" |
| 3535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3536 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3537 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3538 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3539 | psk_identity=abc psk=dead" \ |
| 3540 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3541 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3542 | -S "SSL - Unknown identity received" \ |
| 3543 | -S "SSL - Verification of the message MAC failed" |
| 3544 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3545 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3546 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3547 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3548 | psk_identity=def psk=beef" \ |
| 3549 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3550 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3551 | -S "SSL - Unknown identity received" \ |
| 3552 | -S "SSL - Verification of the message MAC failed" |
| 3553 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3554 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3555 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3556 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3557 | psk_identity=ghi psk=beef" \ |
| 3558 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3559 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3560 | -s "SSL - Unknown identity received" \ |
| 3561 | -S "SSL - Verification of the message MAC failed" |
| 3562 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3563 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3564 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3565 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3566 | psk_identity=abc psk=beef" \ |
| 3567 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3568 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3569 | -S "SSL - Unknown identity received" \ |
| 3570 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3571 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3572 | # Tests for EC J-PAKE |
| 3573 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3575 | run_test "ECJPAKE: client not configured" \ |
| 3576 | "$P_SRV debug_level=3" \ |
| 3577 | "$P_CLI debug_level=3" \ |
| 3578 | 0 \ |
| 3579 | -C "add ciphersuite: c0ff" \ |
| 3580 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3581 | -S "found ecjpake kkpp extension" \ |
| 3582 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3583 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3584 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3585 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3586 | -S "None of the common ciphersuites is usable" |
| 3587 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3588 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3589 | run_test "ECJPAKE: server not configured" \ |
| 3590 | "$P_SRV debug_level=3" \ |
| 3591 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3592 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3593 | 1 \ |
| 3594 | -c "add ciphersuite: c0ff" \ |
| 3595 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3596 | -s "found ecjpake kkpp extension" \ |
| 3597 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3598 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3599 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3600 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3601 | -s "None of the common ciphersuites is usable" |
| 3602 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3603 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3604 | run_test "ECJPAKE: working, TLS" \ |
| 3605 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3606 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3607 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3608 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3609 | -c "add ciphersuite: c0ff" \ |
| 3610 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3611 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3612 | -s "found ecjpake kkpp extension" \ |
| 3613 | -S "skip ecjpake kkpp extension" \ |
| 3614 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3615 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3616 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3617 | -S "None of the common ciphersuites is usable" \ |
| 3618 | -S "SSL - Verification of the message MAC failed" |
| 3619 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3620 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3621 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3622 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 3623 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3624 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3625 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3626 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3627 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3628 | -s "SSL - Verification of the message MAC failed" |
| 3629 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3630 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3631 | run_test "ECJPAKE: working, DTLS" \ |
| 3632 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3633 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3634 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3635 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3636 | -c "re-using cached ecjpake parameters" \ |
| 3637 | -S "SSL - Verification of the message MAC failed" |
| 3638 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3639 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3640 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3641 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3642 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3643 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3644 | 0 \ |
| 3645 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3646 | -S "SSL - Verification of the message MAC failed" |
| 3647 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3648 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3649 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3650 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 3651 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3652 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 3653 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3654 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3655 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3656 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3657 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3658 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3659 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3660 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 3661 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 3662 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 3663 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3664 | 0 |
| 3665 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3666 | # Tests for ciphersuites per version |
| 3667 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3668 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3670 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3671 | "$P_CLI force_version=ssl3" \ |
| 3672 | 0 \ |
| 3673 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3674 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3675 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3676 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 3677 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3678 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3679 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3681 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3682 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3683 | "$P_CLI force_version=tls1_1" \ |
| 3684 | 0 \ |
| 3685 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3686 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3687 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3688 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3689 | "$P_CLI force_version=tls1_2" \ |
| 3690 | 0 \ |
| 3691 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3692 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3693 | # Test for ClientHello without extensions |
| 3694 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3695 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3696 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3697 | "$P_SRV debug_level=3" \ |
| 3698 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3699 | 0 \ |
| 3700 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3701 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3702 | requires_gnutls |
| 3703 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3704 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
| 3705 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3706 | 0 \ |
| 3707 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3708 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3709 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3710 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3711 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3712 | "$P_SRV" \ |
| 3713 | "$P_CLI request_size=100" \ |
| 3714 | 0 \ |
| 3715 | -s "Read from client: 100 bytes read$" |
| 3716 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3717 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3718 | "$P_SRV" \ |
| 3719 | "$P_CLI request_size=500" \ |
| 3720 | 0 \ |
| 3721 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3722 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3723 | # Tests for small packets |
| 3724 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3725 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3726 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3727 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3728 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3729 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3730 | 0 \ |
| 3731 | -s "Read from client: 1 bytes read" |
| 3732 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3733 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3734 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3735 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3736 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3737 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3738 | 0 \ |
| 3739 | -s "Read from client: 1 bytes read" |
| 3740 | |
| 3741 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 3742 | "$P_SRV" \ |
| 3743 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3745 | 0 \ |
| 3746 | -s "Read from client: 1 bytes read" |
| 3747 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3748 | run_test "Small packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3749 | "$P_SRV" \ |
| 3750 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3752 | 0 \ |
| 3753 | -s "Read from client: 1 bytes read" |
| 3754 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3755 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3756 | run_test "Small packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3757 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3758 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3759 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3760 | 0 \ |
| 3761 | -s "Read from client: 1 bytes read" |
| 3762 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3763 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3764 | run_test "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3765 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3766 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3767 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3768 | 0 \ |
| 3769 | -s "Read from client: 1 bytes read" |
| 3770 | |
| 3771 | run_test "Small packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3772 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3773 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3774 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3775 | 0 \ |
| 3776 | -s "Read from client: 1 bytes read" |
| 3777 | |
| 3778 | run_test "Small packet TLS 1.0 StreamCipher, without EtM" \ |
| 3779 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3780 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3781 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3782 | 0 \ |
| 3783 | -s "Read from client: 1 bytes read" |
| 3784 | |
| 3785 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3786 | run_test "Small packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3787 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3788 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3789 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3790 | 0 \ |
| 3791 | -s "Read from client: 1 bytes read" |
| 3792 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3793 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3794 | run_test "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3795 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3796 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3797 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3798 | 0 \ |
| 3799 | -s "Read from client: 1 bytes read" |
| 3800 | |
| 3801 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 3802 | "$P_SRV" \ |
| 3803 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3804 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3805 | 0 \ |
| 3806 | -s "Read from client: 1 bytes read" |
| 3807 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3808 | run_test "Small packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3809 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3810 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3811 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3812 | 0 \ |
| 3813 | -s "Read from client: 1 bytes read" |
| 3814 | |
| 3815 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3816 | run_test "Small packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3817 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3818 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3819 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3820 | 0 \ |
| 3821 | -s "Read from client: 1 bytes read" |
| 3822 | |
| 3823 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3824 | run_test "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3825 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3826 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3827 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3828 | 0 \ |
| 3829 | -s "Read from client: 1 bytes read" |
| 3830 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3831 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3832 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3833 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3834 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3835 | 0 \ |
| 3836 | -s "Read from client: 1 bytes read" |
| 3837 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3838 | run_test "Small packet TLS 1.1 StreamCipher, without EtM" \ |
| 3839 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3840 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3841 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3842 | 0 \ |
| 3843 | -s "Read from client: 1 bytes read" |
| 3844 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3845 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3846 | run_test "Small packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3847 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3848 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3849 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3850 | 0 \ |
| 3851 | -s "Read from client: 1 bytes read" |
| 3852 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3853 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3854 | run_test "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3855 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3856 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3857 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3858 | 0 \ |
| 3859 | -s "Read from client: 1 bytes read" |
| 3860 | |
| 3861 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 3862 | "$P_SRV" \ |
| 3863 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3865 | 0 \ |
| 3866 | -s "Read from client: 1 bytes read" |
| 3867 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3868 | run_test "Small packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3869 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3870 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3871 | 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] | 3872 | 0 \ |
| 3873 | -s "Read from client: 1 bytes read" |
| 3874 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3875 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 3876 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3877 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3878 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3879 | 0 \ |
| 3880 | -s "Read from client: 1 bytes read" |
| 3881 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3882 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3883 | run_test "Small packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3884 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3885 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3886 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3887 | 0 \ |
| 3888 | -s "Read from client: 1 bytes read" |
| 3889 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3890 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3891 | run_test "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3892 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3893 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3895 | 0 \ |
| 3896 | -s "Read from client: 1 bytes read" |
| 3897 | |
| 3898 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3899 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3900 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3901 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3902 | 0 \ |
| 3903 | -s "Read from client: 1 bytes read" |
| 3904 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3905 | run_test "Small packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3906 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3907 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3908 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3909 | 0 \ |
| 3910 | -s "Read from client: 1 bytes read" |
| 3911 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3912 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3913 | run_test "Small packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3914 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3915 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3916 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3917 | 0 \ |
| 3918 | -s "Read from client: 1 bytes read" |
| 3919 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3920 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3921 | run_test "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3922 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3923 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3924 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3925 | 0 \ |
| 3926 | -s "Read from client: 1 bytes read" |
| 3927 | |
| 3928 | run_test "Small packet TLS 1.2 AEAD" \ |
| 3929 | "$P_SRV" \ |
| 3930 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3931 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3932 | 0 \ |
| 3933 | -s "Read from client: 1 bytes read" |
| 3934 | |
| 3935 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 3936 | "$P_SRV" \ |
| 3937 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3938 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3939 | 0 \ |
| 3940 | -s "Read from client: 1 bytes read" |
| 3941 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3942 | # Tests for small packets in DTLS |
| 3943 | |
| 3944 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3945 | run_test "Small packet DTLS 1.0" \ |
| 3946 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 3947 | "$P_CLI dtls=1 request_size=1 \ |
| 3948 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3949 | 0 \ |
| 3950 | -s "Read from client: 1 bytes read" |
| 3951 | |
| 3952 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3953 | run_test "Small packet DTLS 1.0, without EtM" \ |
| 3954 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 3955 | "$P_CLI dtls=1 request_size=1 \ |
| 3956 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3957 | 0 \ |
| 3958 | -s "Read from client: 1 bytes read" |
| 3959 | |
| 3960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3961 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3962 | run_test "Small packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3963 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 3964 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3965 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3966 | 0 \ |
| 3967 | -s "Read from client: 1 bytes read" |
| 3968 | |
| 3969 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3970 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3971 | run_test "Small packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3972 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3973 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3974 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3975 | 0 \ |
| 3976 | -s "Read from client: 1 bytes read" |
| 3977 | |
| 3978 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3979 | run_test "Small packet DTLS 1.2" \ |
| 3980 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 3981 | "$P_CLI dtls=1 request_size=1 \ |
| 3982 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3983 | 0 \ |
| 3984 | -s "Read from client: 1 bytes read" |
| 3985 | |
| 3986 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3987 | run_test "Small packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3988 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3989 | "$P_CLI dtls=1 request_size=1 \ |
| 3990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3991 | 0 \ |
| 3992 | -s "Read from client: 1 bytes read" |
| 3993 | |
| 3994 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3995 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3996 | run_test "Small packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3997 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3998 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3999 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4000 | 0 \ |
| 4001 | -s "Read from client: 1 bytes read" |
| 4002 | |
| 4003 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4004 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4005 | run_test "Small packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4006 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4007 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4008 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4009 | 0 \ |
| 4010 | -s "Read from client: 1 bytes read" |
| 4011 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4012 | # A test for extensions in SSLv3 |
| 4013 | |
| 4014 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4015 | run_test "SSLv3 with extensions, server side" \ |
| 4016 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4017 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4018 | 0 \ |
| 4019 | -S "dumping 'client hello extensions'" \ |
| 4020 | -S "server hello, total extension length:" |
| 4021 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4022 | # Test for large packets |
| 4023 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4024 | # How many fragments do we expect to write $1 bytes? |
| 4025 | fragments_for_write() { |
| 4026 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4027 | } |
| 4028 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4029 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4030 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4031 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4032 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4033 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4034 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4035 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4036 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4037 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4038 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4039 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4040 | "$P_SRV min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4041 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4042 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4043 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4044 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4045 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4046 | |
| 4047 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 4048 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4049 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4050 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4051 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4052 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4053 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4054 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4055 | run_test "Large packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4056 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4057 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4058 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4059 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4060 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4061 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4062 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4063 | run_test "Large packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4064 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4065 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4066 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4067 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4068 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4069 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4070 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4071 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4072 | run_test "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4073 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4074 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4075 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4076 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4077 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4078 | |
| 4079 | run_test "Large packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4080 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4081 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4082 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4083 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4084 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4085 | |
| 4086 | run_test "Large packet TLS 1.0 StreamCipher, without EtM" \ |
| 4087 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4088 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4089 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4090 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4091 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4092 | |
| 4093 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4094 | run_test "Large packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4095 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4096 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4097 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4098 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4099 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4100 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4101 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4102 | run_test "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4103 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4104 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4105 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4106 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4107 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4108 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4109 | |
| 4110 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 4111 | "$P_SRV" \ |
| 4112 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4113 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4114 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4115 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4116 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4117 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4118 | run_test "Large packet TLS 1.1 BlockCipher, without EtM" \ |
| 4119 | "$P_SRV" \ |
| 4120 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4121 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4122 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4123 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4124 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4125 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4126 | run_test "Large packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4127 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4128 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4129 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4130 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4131 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4132 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4133 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4134 | run_test "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4135 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4136 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4137 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4138 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4139 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4140 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4141 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 4142 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4143 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4144 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4145 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4146 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4147 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4148 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4149 | run_test "Large packet TLS 1.1 StreamCipher, without EtM" \ |
| 4150 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4151 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4152 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4153 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4154 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4155 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4156 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4157 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4158 | run_test "Large packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4159 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4160 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4161 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4162 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4163 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4164 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4165 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4166 | run_test "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4167 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4168 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4169 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4170 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4171 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4172 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4173 | |
| 4174 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 4175 | "$P_SRV" \ |
| 4176 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4177 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4178 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4179 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4180 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4181 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4182 | run_test "Large packet TLS 1.2 BlockCipher, without EtM" \ |
| 4183 | "$P_SRV" \ |
| 4184 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4185 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4186 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4187 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4188 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4189 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 4190 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4191 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4192 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4193 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4194 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4195 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4196 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4198 | run_test "Large packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4199 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4200 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4201 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4202 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4203 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4204 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4205 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4206 | run_test "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4207 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4208 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4209 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4210 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4211 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4212 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4213 | |
| 4214 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4215 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4216 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4217 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4218 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4219 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4220 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4221 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4222 | run_test "Large packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4223 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4224 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4225 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4226 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4227 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4228 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4229 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4230 | run_test "Large packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4231 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4232 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4233 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4234 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4235 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4236 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4237 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4238 | run_test "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4239 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4240 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4241 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4242 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4243 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4244 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4245 | |
| 4246 | run_test "Large packet TLS 1.2 AEAD" \ |
| 4247 | "$P_SRV" \ |
| 4248 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4249 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4250 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4251 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4252 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4253 | |
| 4254 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 4255 | "$P_SRV" \ |
| 4256 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4257 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4258 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4259 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4260 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4261 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4262 | # Tests of asynchronous private key support in SSL |
| 4263 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4264 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4265 | run_test "SSL async private: sign, delay=0" \ |
| 4266 | "$P_SRV \ |
| 4267 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4268 | "$P_CLI" \ |
| 4269 | 0 \ |
| 4270 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4271 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4272 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4273 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4274 | run_test "SSL async private: sign, delay=1" \ |
| 4275 | "$P_SRV \ |
| 4276 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4277 | "$P_CLI" \ |
| 4278 | 0 \ |
| 4279 | -s "Async sign callback: using key slot " \ |
| 4280 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4281 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4282 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4283 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4284 | run_test "SSL async private: sign, delay=2" \ |
| 4285 | "$P_SRV \ |
| 4286 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 4287 | "$P_CLI" \ |
| 4288 | 0 \ |
| 4289 | -s "Async sign callback: using key slot " \ |
| 4290 | -U "Async sign callback: using key slot " \ |
| 4291 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 4292 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4293 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4294 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4295 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 4296 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 4297 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4299 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 4300 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 4301 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 4302 | "$P_CLI force_version=tls1_1" \ |
| 4303 | 0 \ |
| 4304 | -s "Async sign callback: using key slot " \ |
| 4305 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4306 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4307 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4308 | run_test "SSL async private: sign, SNI" \ |
| 4309 | "$P_SRV debug_level=3 \ |
| 4310 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 4311 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4312 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4313 | "$P_CLI server_name=polarssl.example" \ |
| 4314 | 0 \ |
| 4315 | -s "Async sign callback: using key slot " \ |
| 4316 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4317 | -s "parse ServerName extension" \ |
| 4318 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4319 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4320 | |
| 4321 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4322 | run_test "SSL async private: decrypt, delay=0" \ |
| 4323 | "$P_SRV \ |
| 4324 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4325 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4326 | 0 \ |
| 4327 | -s "Async decrypt callback: using key slot " \ |
| 4328 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4329 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4330 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4331 | run_test "SSL async private: decrypt, delay=1" \ |
| 4332 | "$P_SRV \ |
| 4333 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4334 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4335 | 0 \ |
| 4336 | -s "Async decrypt callback: using key slot " \ |
| 4337 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4338 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4339 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4340 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4341 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 4342 | "$P_SRV psk=abc123 \ |
| 4343 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4344 | "$P_CLI psk=abc123 \ |
| 4345 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4346 | 0 \ |
| 4347 | -s "Async decrypt callback: using key slot " \ |
| 4348 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4349 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4350 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4351 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 4352 | "$P_SRV psk=abc123 \ |
| 4353 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4354 | "$P_CLI psk=abc123 \ |
| 4355 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4356 | 0 \ |
| 4357 | -s "Async decrypt callback: using key slot " \ |
| 4358 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4359 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4360 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4361 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4362 | run_test "SSL async private: sign callback not present" \ |
| 4363 | "$P_SRV \ |
| 4364 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4365 | "$P_CLI; [ \$? -eq 1 ] && |
| 4366 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4367 | 0 \ |
| 4368 | -S "Async sign callback" \ |
| 4369 | -s "! mbedtls_ssl_handshake returned" \ |
| 4370 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 4371 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 4372 | -s "Successful connection" |
| 4373 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4374 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4375 | run_test "SSL async private: decrypt callback not present" \ |
| 4376 | "$P_SRV debug_level=1 \ |
| 4377 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 4378 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 4379 | [ \$? -eq 1 ] && $P_CLI" \ |
| 4380 | 0 \ |
| 4381 | -S "Async decrypt callback" \ |
| 4382 | -s "! mbedtls_ssl_handshake returned" \ |
| 4383 | -s "got no RSA private key" \ |
| 4384 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4385 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4386 | |
| 4387 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4388 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4389 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4390 | "$P_SRV \ |
| 4391 | async_operations=s async_private_delay1=1 \ |
| 4392 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4393 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4394 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4395 | 0 \ |
| 4396 | -s "Async sign callback: using key slot 0," \ |
| 4397 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4398 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4399 | |
| 4400 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4401 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4402 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4403 | "$P_SRV \ |
| 4404 | async_operations=s async_private_delay2=1 \ |
| 4405 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4406 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4407 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4408 | 0 \ |
| 4409 | -s "Async sign callback: using key slot 0," \ |
| 4410 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4411 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4412 | |
| 4413 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4415 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4416 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4417 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4418 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4419 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4420 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4421 | 0 \ |
| 4422 | -s "Async sign callback: using key slot 1," \ |
| 4423 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4424 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4425 | |
| 4426 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4427 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4428 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4429 | "$P_SRV \ |
| 4430 | async_operations=s async_private_delay1=1 \ |
| 4431 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4432 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4433 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4434 | 0 \ |
| 4435 | -s "Async sign callback: no key matches this certificate." |
| 4436 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4438 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4439 | "$P_SRV \ |
| 4440 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4441 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4442 | "$P_CLI" \ |
| 4443 | 1 \ |
| 4444 | -s "Async sign callback: injected error" \ |
| 4445 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4446 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4447 | -s "! mbedtls_ssl_handshake returned" |
| 4448 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4449 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4450 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4451 | "$P_SRV \ |
| 4452 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4453 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4454 | "$P_CLI" \ |
| 4455 | 1 \ |
| 4456 | -s "Async sign callback: using key slot " \ |
| 4457 | -S "Async resume" \ |
| 4458 | -s "Async cancel" |
| 4459 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4460 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4461 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4462 | "$P_SRV \ |
| 4463 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4464 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4465 | "$P_CLI" \ |
| 4466 | 1 \ |
| 4467 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4468 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4469 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4470 | -s "! mbedtls_ssl_handshake returned" |
| 4471 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4472 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4473 | run_test "SSL async private: decrypt, error in start" \ |
| 4474 | "$P_SRV \ |
| 4475 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4476 | async_private_error=1" \ |
| 4477 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4478 | 1 \ |
| 4479 | -s "Async decrypt callback: injected error" \ |
| 4480 | -S "Async resume" \ |
| 4481 | -S "Async cancel" \ |
| 4482 | -s "! mbedtls_ssl_handshake returned" |
| 4483 | |
| 4484 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4485 | run_test "SSL async private: decrypt, cancel after start" \ |
| 4486 | "$P_SRV \ |
| 4487 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4488 | async_private_error=2" \ |
| 4489 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4490 | 1 \ |
| 4491 | -s "Async decrypt callback: using key slot " \ |
| 4492 | -S "Async resume" \ |
| 4493 | -s "Async cancel" |
| 4494 | |
| 4495 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4496 | run_test "SSL async private: decrypt, error in resume" \ |
| 4497 | "$P_SRV \ |
| 4498 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4499 | async_private_error=3" \ |
| 4500 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4501 | 1 \ |
| 4502 | -s "Async decrypt callback: using key slot " \ |
| 4503 | -s "Async resume callback: decrypt done but injected error" \ |
| 4504 | -S "Async cancel" \ |
| 4505 | -s "! mbedtls_ssl_handshake returned" |
| 4506 | |
| 4507 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4508 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4509 | "$P_SRV \ |
| 4510 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4511 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4512 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4513 | 0 \ |
| 4514 | -s "Async cancel" \ |
| 4515 | -s "! mbedtls_ssl_handshake returned" \ |
| 4516 | -s "Async resume" \ |
| 4517 | -s "Successful connection" |
| 4518 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4519 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4520 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4521 | "$P_SRV \ |
| 4522 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4523 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4524 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4525 | 0 \ |
| 4526 | -s "! mbedtls_ssl_handshake returned" \ |
| 4527 | -s "Async resume" \ |
| 4528 | -s "Successful connection" |
| 4529 | |
| 4530 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4531 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4532 | 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] | 4533 | "$P_SRV \ |
| 4534 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 4535 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4536 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4537 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4538 | [ \$? -eq 1 ] && |
| 4539 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4540 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4541 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4542 | -S "Async resume" \ |
| 4543 | -s "Async cancel" \ |
| 4544 | -s "! mbedtls_ssl_handshake returned" \ |
| 4545 | -s "Async sign callback: no key matches this certificate." \ |
| 4546 | -s "Successful connection" |
| 4547 | |
| 4548 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4549 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4550 | 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] | 4551 | "$P_SRV \ |
| 4552 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 4553 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4554 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4555 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4556 | [ \$? -eq 1 ] && |
| 4557 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4558 | 0 \ |
| 4559 | -s "Async resume" \ |
| 4560 | -s "! mbedtls_ssl_handshake returned" \ |
| 4561 | -s "Async sign callback: no key matches this certificate." \ |
| 4562 | -s "Successful connection" |
| 4563 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4565 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4566 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 4567 | "$P_SRV \ |
| 4568 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4569 | exchanges=2 renegotiation=1" \ |
| 4570 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4571 | 0 \ |
| 4572 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4573 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4574 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4577 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 4578 | "$P_SRV \ |
| 4579 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4580 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4581 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 4582 | 0 \ |
| 4583 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4584 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4585 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4586 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4588 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 4589 | "$P_SRV \ |
| 4590 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4591 | exchanges=2 renegotiation=1" \ |
| 4592 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 4593 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4594 | 0 \ |
| 4595 | -s "Async decrypt callback: using key slot " \ |
| 4596 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4597 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4598 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4599 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4600 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 4601 | "$P_SRV \ |
| 4602 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4603 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4604 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 4605 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4606 | 0 \ |
| 4607 | -s "Async decrypt callback: using key slot " \ |
| 4608 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4609 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4610 | # Tests for DTLS HelloVerifyRequest |
| 4611 | |
| 4612 | run_test "DTLS cookie: enabled" \ |
| 4613 | "$P_SRV dtls=1 debug_level=2" \ |
| 4614 | "$P_CLI dtls=1 debug_level=2" \ |
| 4615 | 0 \ |
| 4616 | -s "cookie verification failed" \ |
| 4617 | -s "cookie verification passed" \ |
| 4618 | -S "cookie verification skipped" \ |
| 4619 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4620 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4621 | -S "SSL - The requested feature is not available" |
| 4622 | |
| 4623 | run_test "DTLS cookie: disabled" \ |
| 4624 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4625 | "$P_CLI dtls=1 debug_level=2" \ |
| 4626 | 0 \ |
| 4627 | -S "cookie verification failed" \ |
| 4628 | -S "cookie verification passed" \ |
| 4629 | -s "cookie verification skipped" \ |
| 4630 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4631 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4632 | -S "SSL - The requested feature is not available" |
| 4633 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4634 | run_test "DTLS cookie: default (failing)" \ |
| 4635 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4636 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4637 | 1 \ |
| 4638 | -s "cookie verification failed" \ |
| 4639 | -S "cookie verification passed" \ |
| 4640 | -S "cookie verification skipped" \ |
| 4641 | -C "received hello verify request" \ |
| 4642 | -S "hello verification requested" \ |
| 4643 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4644 | |
| 4645 | requires_ipv6 |
| 4646 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4647 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4648 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4649 | 0 \ |
| 4650 | -s "cookie verification failed" \ |
| 4651 | -s "cookie verification passed" \ |
| 4652 | -S "cookie verification skipped" \ |
| 4653 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4654 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4655 | -S "SSL - The requested feature is not available" |
| 4656 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4657 | run_test "DTLS cookie: enabled, nbio" \ |
| 4658 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 4659 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4660 | 0 \ |
| 4661 | -s "cookie verification failed" \ |
| 4662 | -s "cookie verification passed" \ |
| 4663 | -S "cookie verification skipped" \ |
| 4664 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4665 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4666 | -S "SSL - The requested feature is not available" |
| 4667 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4668 | # Tests for client reconnecting from the same port with DTLS |
| 4669 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4670 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4671 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4672 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4673 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4674 | 0 \ |
| 4675 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4676 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4677 | -S "Client initiated reconnection from same port" |
| 4678 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4679 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4680 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4681 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4682 | "$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] | 4683 | 0 \ |
| 4684 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4685 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4686 | -s "Client initiated reconnection from same port" |
| 4687 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4688 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4689 | 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] | 4690 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4691 | "$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] | 4692 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4693 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4694 | -s "Client initiated reconnection from same port" |
| 4695 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4696 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 4697 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 4698 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 4699 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4700 | 0 \ |
| 4701 | -S "The operation timed out" \ |
| 4702 | -s "Client initiated reconnection from same port" |
| 4703 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4704 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 4705 | "$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] | 4706 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4707 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4708 | -s "The operation timed out" \ |
| 4709 | -S "Client initiated reconnection from same port" |
| 4710 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4711 | # Tests for various cases of client authentication with DTLS |
| 4712 | # (focused on handshake flows and message parsing) |
| 4713 | |
| 4714 | run_test "DTLS client auth: required" \ |
| 4715 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4716 | "$P_CLI dtls=1" \ |
| 4717 | 0 \ |
| 4718 | -s "Verifying peer X.509 certificate... ok" |
| 4719 | |
| 4720 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4721 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4722 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4723 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4724 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4725 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4726 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4727 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4728 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4729 | 0 \ |
| 4730 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4731 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4732 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4733 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4734 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4735 | "$P_CLI dtls=1 psk=abc124" \ |
| 4736 | 1 \ |
| 4737 | -s "SSL - Verification of the message MAC failed" \ |
| 4738 | -c "SSL - A fatal alert message was received from our peer" |
| 4739 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4740 | # Tests for receiving fragmented handshake messages with DTLS |
| 4741 | |
| 4742 | requires_gnutls |
| 4743 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4744 | "$G_SRV -u --mtu 2048 -a" \ |
| 4745 | "$P_CLI dtls=1 debug_level=2" \ |
| 4746 | 0 \ |
| 4747 | -C "found fragmented DTLS handshake message" \ |
| 4748 | -C "error" |
| 4749 | |
| 4750 | requires_gnutls |
| 4751 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4752 | "$G_SRV -u --mtu 512" \ |
| 4753 | "$P_CLI dtls=1 debug_level=2" \ |
| 4754 | 0 \ |
| 4755 | -c "found fragmented DTLS handshake message" \ |
| 4756 | -C "error" |
| 4757 | |
| 4758 | requires_gnutls |
| 4759 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 4760 | "$G_SRV -u --mtu 128" \ |
| 4761 | "$P_CLI dtls=1 debug_level=2" \ |
| 4762 | 0 \ |
| 4763 | -c "found fragmented DTLS handshake message" \ |
| 4764 | -C "error" |
| 4765 | |
| 4766 | requires_gnutls |
| 4767 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 4768 | "$G_SRV -u --mtu 128" \ |
| 4769 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4770 | 0 \ |
| 4771 | -c "found fragmented DTLS handshake message" \ |
| 4772 | -C "error" |
| 4773 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4774 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4775 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4776 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4777 | "$G_SRV -u --mtu 256" \ |
| 4778 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4779 | 0 \ |
| 4780 | -c "found fragmented DTLS handshake message" \ |
| 4781 | -c "client hello, adding renegotiation extension" \ |
| 4782 | -c "found renegotiation extension" \ |
| 4783 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4784 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4785 | -C "error" \ |
| 4786 | -s "Extra-header:" |
| 4787 | |
| 4788 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4790 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4791 | "$G_SRV -u --mtu 256" \ |
| 4792 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4793 | 0 \ |
| 4794 | -c "found fragmented DTLS handshake message" \ |
| 4795 | -c "client hello, adding renegotiation extension" \ |
| 4796 | -c "found renegotiation extension" \ |
| 4797 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4798 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4799 | -C "error" \ |
| 4800 | -s "Extra-header:" |
| 4801 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4802 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4803 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4804 | "$P_CLI dtls=1 debug_level=2" \ |
| 4805 | 0 \ |
| 4806 | -C "found fragmented DTLS handshake message" \ |
| 4807 | -C "error" |
| 4808 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4809 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4810 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4811 | "$P_CLI dtls=1 debug_level=2" \ |
| 4812 | 0 \ |
| 4813 | -c "found fragmented DTLS handshake message" \ |
| 4814 | -C "error" |
| 4815 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4816 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4817 | "$O_SRV -dtls1 -mtu 256" \ |
| 4818 | "$P_CLI dtls=1 debug_level=2" \ |
| 4819 | 0 \ |
| 4820 | -c "found fragmented DTLS handshake message" \ |
| 4821 | -C "error" |
| 4822 | |
| 4823 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4824 | "$O_SRV -dtls1 -mtu 256" \ |
| 4825 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4826 | 0 \ |
| 4827 | -c "found fragmented DTLS handshake message" \ |
| 4828 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4829 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4830 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4831 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4832 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4833 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4834 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4835 | "$P_SRV dtls=1 debug_level=2" \ |
| 4836 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4837 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4838 | -C "replayed record" \ |
| 4839 | -S "replayed record" \ |
| 4840 | -C "record from another epoch" \ |
| 4841 | -S "record from another epoch" \ |
| 4842 | -C "discarding invalid record" \ |
| 4843 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4844 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4845 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4846 | -c "HTTP/1.0 200 OK" |
| 4847 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4848 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4849 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4850 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4851 | "$P_SRV dtls=1 debug_level=2" \ |
| 4852 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4853 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4854 | -c "replayed record" \ |
| 4855 | -s "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4856 | -c "record from another epoch" \ |
| 4857 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4858 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4859 | -s "Extra-header:" \ |
| 4860 | -c "HTTP/1.0 200 OK" |
| 4861 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4862 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 4863 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4864 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 4865 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4866 | 0 \ |
| 4867 | -c "replayed record" \ |
| 4868 | -S "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4869 | -c "record from another epoch" \ |
| 4870 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4871 | -c "resend" \ |
| 4872 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4873 | -s "Extra-header:" \ |
| 4874 | -c "HTTP/1.0 200 OK" |
| 4875 | |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4876 | run_test "DTLS proxy: multiple records in same datagram" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4877 | -p "$P_PXY pack=50" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4878 | "$P_SRV dtls=1 debug_level=2" \ |
| 4879 | "$P_CLI dtls=1 debug_level=2" \ |
| 4880 | 0 \ |
| 4881 | -c "next record in same datagram" \ |
| 4882 | -s "next record in same datagram" |
| 4883 | |
| 4884 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4885 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4886 | "$P_SRV dtls=1 debug_level=2" \ |
| 4887 | "$P_CLI dtls=1 debug_level=2" \ |
| 4888 | 0 \ |
| 4889 | -c "next record in same datagram" \ |
| 4890 | -s "next record in same datagram" |
| 4891 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4892 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4893 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4894 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4895 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4896 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4897 | -c "discarding invalid record (mac)" \ |
| 4898 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4899 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4900 | -c "HTTP/1.0 200 OK" \ |
| 4901 | -S "too many records with bad MAC" \ |
| 4902 | -S "Verification of the message MAC failed" |
| 4903 | |
| 4904 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 4905 | -p "$P_PXY bad_ad=1" \ |
| 4906 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 4907 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4908 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4909 | -C "discarding invalid record (mac)" \ |
| 4910 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4911 | -S "Extra-header:" \ |
| 4912 | -C "HTTP/1.0 200 OK" \ |
| 4913 | -s "too many records with bad MAC" \ |
| 4914 | -s "Verification of the message MAC failed" |
| 4915 | |
| 4916 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 4917 | -p "$P_PXY bad_ad=1" \ |
| 4918 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 4919 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4920 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4921 | -c "discarding invalid record (mac)" \ |
| 4922 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4923 | -s "Extra-header:" \ |
| 4924 | -c "HTTP/1.0 200 OK" \ |
| 4925 | -S "too many records with bad MAC" \ |
| 4926 | -S "Verification of the message MAC failed" |
| 4927 | |
| 4928 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 4929 | -p "$P_PXY bad_ad=1" \ |
| 4930 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 4931 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 4932 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4933 | -c "discarding invalid record (mac)" \ |
| 4934 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4935 | -s "Extra-header:" \ |
| 4936 | -c "HTTP/1.0 200 OK" \ |
| 4937 | -s "too many records with bad MAC" \ |
| 4938 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4939 | |
| 4940 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4941 | -p "$P_PXY delay_ccs=1" \ |
| 4942 | "$P_SRV dtls=1 debug_level=1" \ |
| 4943 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4944 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4945 | -c "record from another epoch" \ |
| 4946 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4947 | -s "Extra-header:" \ |
| 4948 | -c "HTTP/1.0 200 OK" |
| 4949 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4950 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4951 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4952 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4953 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4954 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4955 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4956 | psk=abc123" \ |
| 4957 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4958 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4959 | 0 \ |
| 4960 | -s "Extra-header:" \ |
| 4961 | -c "HTTP/1.0 200 OK" |
| 4962 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4963 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4964 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 4965 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4966 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4967 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4968 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4969 | 0 \ |
| 4970 | -s "Extra-header:" \ |
| 4971 | -c "HTTP/1.0 200 OK" |
| 4972 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4973 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4974 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 4975 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4976 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4977 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4978 | 0 \ |
| 4979 | -s "Extra-header:" \ |
| 4980 | -c "HTTP/1.0 200 OK" |
| 4981 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4982 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4983 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 4984 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4985 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 4986 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4987 | 0 \ |
| 4988 | -s "Extra-header:" \ |
| 4989 | -c "HTTP/1.0 200 OK" |
| 4990 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4991 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4992 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 4993 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4994 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 4995 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4996 | 0 \ |
| 4997 | -s "Extra-header:" \ |
| 4998 | -c "HTTP/1.0 200 OK" |
| 4999 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5000 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 5001 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 5002 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5003 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 5004 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5005 | 0 \ |
| 5006 | -s "Extra-header:" \ |
| 5007 | -c "HTTP/1.0 200 OK" |
| 5008 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5009 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5010 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 5011 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5012 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 5013 | auth_mode=required" \ |
| 5014 | "$P_CLI dtls=1 hs_timeout=250-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5015 | 0 \ |
| 5016 | -s "Extra-header:" \ |
| 5017 | -c "HTTP/1.0 200 OK" |
| 5018 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5019 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 5020 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 5021 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5022 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5023 | psk=abc123 debug_level=3" \ |
| 5024 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5025 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5026 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5027 | 0 \ |
| 5028 | -s "a session has been resumed" \ |
| 5029 | -c "a session has been resumed" \ |
| 5030 | -s "Extra-header:" \ |
| 5031 | -c "HTTP/1.0 200 OK" |
| 5032 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5033 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 5034 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 5035 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5036 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5037 | psk=abc123 debug_level=3 nbio=2" \ |
| 5038 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5039 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5040 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 5041 | 0 \ |
| 5042 | -s "a session has been resumed" \ |
| 5043 | -c "a session has been resumed" \ |
| 5044 | -s "Extra-header:" \ |
| 5045 | -c "HTTP/1.0 200 OK" |
| 5046 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5047 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5049 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5051 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5052 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5053 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5054 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5055 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5056 | 0 \ |
| 5057 | -c "=> renegotiate" \ |
| 5058 | -s "=> renegotiate" \ |
| 5059 | -s "Extra-header:" \ |
| 5060 | -c "HTTP/1.0 200 OK" |
| 5061 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5062 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5063 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5064 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 5065 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5066 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5067 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5068 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5069 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5070 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5071 | 0 \ |
| 5072 | -c "=> renegotiate" \ |
| 5073 | -s "=> renegotiate" \ |
| 5074 | -s "Extra-header:" \ |
| 5075 | -c "HTTP/1.0 200 OK" |
| 5076 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5077 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5078 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5079 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5080 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5081 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5082 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5083 | debug_level=2" \ |
| 5084 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5085 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5086 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5087 | 0 \ |
| 5088 | -c "=> renegotiate" \ |
| 5089 | -s "=> renegotiate" \ |
| 5090 | -s "Extra-header:" \ |
| 5091 | -c "HTTP/1.0 200 OK" |
| 5092 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5093 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5094 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5095 | 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] | 5096 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5097 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5098 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5099 | debug_level=2 nbio=2" \ |
| 5100 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5101 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5102 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5103 | 0 \ |
| 5104 | -c "=> renegotiate" \ |
| 5105 | -s "=> renegotiate" \ |
| 5106 | -s "Extra-header:" \ |
| 5107 | -c "HTTP/1.0 200 OK" |
| 5108 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5109 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5110 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5111 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5112 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5113 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5114 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5115 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5116 | -c "HTTP/1.0 200 OK" |
| 5117 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5118 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5119 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5120 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 5121 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5122 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5123 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5124 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5125 | -c "HTTP/1.0 200 OK" |
| 5126 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5127 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5128 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5129 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 5130 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5131 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5132 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5133 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5134 | -c "HTTP/1.0 200 OK" |
| 5135 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5136 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5137 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5138 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5139 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 5140 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5141 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5142 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5143 | 0 \ |
| 5144 | -s "Extra-header:" \ |
| 5145 | -c "Extra-header:" |
| 5146 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5147 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5148 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5149 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5150 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 5151 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5152 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5153 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5154 | 0 \ |
| 5155 | -s "Extra-header:" \ |
| 5156 | -c "Extra-header:" |
| 5157 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5158 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5159 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5160 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5161 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 5162 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5163 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5164 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5165 | 0 \ |
| 5166 | -s "Extra-header:" \ |
| 5167 | -c "Extra-header:" |
| 5168 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5169 | # Final report |
| 5170 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5171 | echo "------------------------------------------------------------------------" |
| 5172 | |
| 5173 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5174 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5175 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5176 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5177 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 5178 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 5179 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5180 | |
| 5181 | exit $FAILS |