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 |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame^] | 635 | if [ -n "$PXY_CMD" ]; then |
| 636 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 637 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 638 | fi |
| 639 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 640 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 641 | } |
| 642 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 643 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 644 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 645 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 646 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 647 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 648 | 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] | 649 | exit 1 |
| 650 | } |
| 651 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 652 | # |
| 653 | # MAIN |
| 654 | # |
| 655 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 656 | get_options "$@" |
| 657 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 658 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 659 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 660 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 661 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 662 | if [ ! -x "$P_SRV_BIN" ]; then |
| 663 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 664 | exit 1 |
| 665 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 666 | if [ ! -x "$P_CLI_BIN" ]; then |
| 667 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 668 | exit 1 |
| 669 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 670 | if [ ! -x "$P_PXY_BIN" ]; then |
| 671 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 672 | exit 1 |
| 673 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 674 | if [ "$MEMCHECK" -gt 0 ]; then |
| 675 | if which valgrind >/dev/null 2>&1; then :; else |
| 676 | echo "Memcheck not possible. Valgrind not found" |
| 677 | exit 1 |
| 678 | fi |
| 679 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 680 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 681 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 682 | exit 1 |
| 683 | fi |
| 684 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 685 | # used by watchdog |
| 686 | MAIN_PID="$$" |
| 687 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 688 | # We use somewhat arbitrary delays for tests: |
| 689 | # - how long do we wait for the server to start (when lsof not available)? |
| 690 | # - how long do we allow for the client to finish? |
| 691 | # (not to check performance, just to avoid waiting indefinitely) |
| 692 | # Things are slower with valgrind, so give extra time here. |
| 693 | # |
| 694 | # Note: without lsof, there is a trade-off between the running time of this |
| 695 | # script and the risk of spurious errors because we didn't wait long enough. |
| 696 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 697 | # 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] | 698 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 699 | START_DELAY=6 |
| 700 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 701 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 702 | START_DELAY=2 |
| 703 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 704 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 705 | |
| 706 | # some particular tests need more time: |
| 707 | # - for the client, we multiply the usual watchdog limit by a factor |
| 708 | # - for the server, we sleep for a number of seconds after the client exits |
| 709 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 710 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 711 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 712 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 713 | # 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] | 714 | # +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] | 715 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 716 | 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] | 717 | 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] | 718 | 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] | 719 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 720 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 721 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 722 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 723 | # Allow SHA-1, because many of our test certificates use it |
| 724 | P_SRV="$P_SRV allow_sha1=1" |
| 725 | P_CLI="$P_CLI allow_sha1=1" |
| 726 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 727 | # Also pick a unique name for intermediate files |
| 728 | SRV_OUT="srv_out.$$" |
| 729 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 730 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 731 | SESSION="session.$$" |
| 732 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 733 | SKIP_NEXT="NO" |
| 734 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 735 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 736 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 737 | # Basic test |
| 738 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 739 | # Checks that: |
| 740 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 741 | # - the expected (highest security) parameters are selected |
| 742 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 743 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 744 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 745 | "$P_CLI" \ |
| 746 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 747 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 748 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 749 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 750 | -s "ECDHE curve: secp521r1" \ |
| 751 | -S "error" \ |
| 752 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 753 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 754 | run_test "Default, DTLS" \ |
| 755 | "$P_SRV dtls=1" \ |
| 756 | "$P_CLI dtls=1" \ |
| 757 | 0 \ |
| 758 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 759 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 760 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 761 | # Test current time in ServerHello |
| 762 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 763 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 764 | "$P_SRV debug_level=3" \ |
| 765 | "$P_CLI debug_level=3" \ |
| 766 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 767 | -f "check_server_hello_time" \ |
| 768 | -F "check_server_hello_time" |
| 769 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 770 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 771 | run_test "Unique IV in GCM" \ |
| 772 | "$P_SRV exchanges=20 debug_level=4" \ |
| 773 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 774 | 0 \ |
| 775 | -u "IV used" \ |
| 776 | -U "IV used" |
| 777 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 778 | # Tests for rc4 option |
| 779 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 780 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 781 | run_test "RC4: server disabled, client enabled" \ |
| 782 | "$P_SRV" \ |
| 783 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 784 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 785 | -s "SSL - The server has no ciphersuites in common" |
| 786 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 787 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 788 | run_test "RC4: server half, client enabled" \ |
| 789 | "$P_SRV arc4=1" \ |
| 790 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 791 | 1 \ |
| 792 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 793 | |
| 794 | run_test "RC4: server enabled, client disabled" \ |
| 795 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 796 | "$P_CLI" \ |
| 797 | 1 \ |
| 798 | -s "SSL - The server has no ciphersuites in common" |
| 799 | |
| 800 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 801 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 802 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 803 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 804 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 805 | -S "SSL - The server has no ciphersuites in common" |
| 806 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 807 | # Tests for SHA-1 support |
| 808 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 809 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 810 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 811 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 812 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 813 | 1 \ |
| 814 | -c "The certificate is signed with an unacceptable hash" |
| 815 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 816 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 817 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 818 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 819 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 820 | 0 |
| 821 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 822 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 823 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 824 | "$P_CLI allow_sha1=1" \ |
| 825 | 0 |
| 826 | |
| 827 | run_test "SHA-256 allowed by default in server certificate" \ |
| 828 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 829 | "$P_CLI allow_sha1=0" \ |
| 830 | 0 |
| 831 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 832 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 833 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 834 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 835 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 836 | 1 \ |
| 837 | -s "The certificate is signed with an unacceptable hash" |
| 838 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 839 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 840 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 841 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 842 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 843 | 0 |
| 844 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 845 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 846 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 847 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 848 | 0 |
| 849 | |
| 850 | run_test "SHA-256 allowed by default in client certificate" \ |
| 851 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 852 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 853 | 0 |
| 854 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 855 | # Tests for Truncated HMAC extension |
| 856 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 857 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 858 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 859 | "$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] | 860 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 861 | -s "dumping 'expected mac' (20 bytes)" \ |
| 862 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 863 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 864 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 865 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 866 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 867 | "$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] | 868 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 869 | -s "dumping 'expected mac' (20 bytes)" \ |
| 870 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 871 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 872 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 873 | run_test "Truncated HMAC: client enabled, server default" \ |
| 874 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 875 | "$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] | 876 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 877 | -s "dumping 'expected mac' (20 bytes)" \ |
| 878 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 879 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 880 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 881 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 882 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 883 | "$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] | 884 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 885 | -s "dumping 'expected mac' (20 bytes)" \ |
| 886 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 887 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 888 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 889 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 890 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 891 | "$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] | 892 | 0 \ |
| 893 | -s "dumping 'expected mac' (20 bytes)" \ |
| 894 | -S "dumping 'expected mac' (10 bytes)" |
| 895 | |
| 896 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 897 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 898 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 899 | "$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] | 900 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 901 | -S "dumping 'expected mac' (20 bytes)" \ |
| 902 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 903 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 904 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 905 | "$P_SRV dtls=1 debug_level=4" \ |
| 906 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 907 | 0 \ |
| 908 | -s "dumping 'expected mac' (20 bytes)" \ |
| 909 | -S "dumping 'expected mac' (10 bytes)" |
| 910 | |
| 911 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 912 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 913 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 914 | "$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] | 915 | 0 \ |
| 916 | -s "dumping 'expected mac' (20 bytes)" \ |
| 917 | -S "dumping 'expected mac' (10 bytes)" |
| 918 | |
| 919 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 920 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 921 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 922 | "$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] | 923 | 0 \ |
| 924 | -s "dumping 'expected mac' (20 bytes)" \ |
| 925 | -S "dumping 'expected mac' (10 bytes)" |
| 926 | |
| 927 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 928 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 929 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 930 | "$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] | 931 | 0 \ |
| 932 | -s "dumping 'expected mac' (20 bytes)" \ |
| 933 | -S "dumping 'expected mac' (10 bytes)" |
| 934 | |
| 935 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 936 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 937 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 938 | "$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] | 939 | 0 \ |
| 940 | -s "dumping 'expected mac' (20 bytes)" \ |
| 941 | -S "dumping 'expected mac' (10 bytes)" |
| 942 | |
| 943 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 944 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 945 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 946 | "$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] | 947 | 0 \ |
| 948 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 949 | -s "dumping 'expected mac' (10 bytes)" |
| 950 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 951 | # Tests for Encrypt-then-MAC extension |
| 952 | |
| 953 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 954 | "$P_SRV debug_level=3 \ |
| 955 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 956 | "$P_CLI debug_level=3" \ |
| 957 | 0 \ |
| 958 | -c "client hello, adding encrypt_then_mac extension" \ |
| 959 | -s "found encrypt then mac extension" \ |
| 960 | -s "server hello, adding encrypt then mac extension" \ |
| 961 | -c "found encrypt_then_mac extension" \ |
| 962 | -c "using encrypt then mac" \ |
| 963 | -s "using encrypt then mac" |
| 964 | |
| 965 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 966 | "$P_SRV debug_level=3 etm=0 \ |
| 967 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 968 | "$P_CLI debug_level=3 etm=1" \ |
| 969 | 0 \ |
| 970 | -c "client hello, adding encrypt_then_mac extension" \ |
| 971 | -s "found encrypt then mac extension" \ |
| 972 | -S "server hello, adding encrypt then mac extension" \ |
| 973 | -C "found encrypt_then_mac extension" \ |
| 974 | -C "using encrypt then mac" \ |
| 975 | -S "using encrypt then mac" |
| 976 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 977 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 978 | "$P_SRV debug_level=3 etm=1 \ |
| 979 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 980 | "$P_CLI debug_level=3 etm=1" \ |
| 981 | 0 \ |
| 982 | -c "client hello, adding encrypt_then_mac extension" \ |
| 983 | -s "found encrypt then mac extension" \ |
| 984 | -S "server hello, adding encrypt then mac extension" \ |
| 985 | -C "found encrypt_then_mac extension" \ |
| 986 | -C "using encrypt then mac" \ |
| 987 | -S "using encrypt then mac" |
| 988 | |
| 989 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 990 | "$P_SRV debug_level=3 etm=1 \ |
| 991 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 992 | "$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] | 993 | 0 \ |
| 994 | -c "client hello, adding encrypt_then_mac extension" \ |
| 995 | -s "found encrypt then mac extension" \ |
| 996 | -S "server hello, adding encrypt then mac extension" \ |
| 997 | -C "found encrypt_then_mac extension" \ |
| 998 | -C "using encrypt then mac" \ |
| 999 | -S "using encrypt then mac" |
| 1000 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1001 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1002 | "$P_SRV debug_level=3 etm=1 \ |
| 1003 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1004 | "$P_CLI debug_level=3 etm=0" \ |
| 1005 | 0 \ |
| 1006 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1007 | -S "found encrypt then mac extension" \ |
| 1008 | -S "server hello, adding encrypt then mac extension" \ |
| 1009 | -C "found encrypt_then_mac extension" \ |
| 1010 | -C "using encrypt then mac" \ |
| 1011 | -S "using encrypt then mac" |
| 1012 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1013 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1014 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1015 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1016 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1017 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1018 | 0 \ |
| 1019 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1020 | -S "found encrypt then mac extension" \ |
| 1021 | -S "server hello, adding encrypt then mac extension" \ |
| 1022 | -C "found encrypt_then_mac extension" \ |
| 1023 | -C "using encrypt then mac" \ |
| 1024 | -S "using encrypt then mac" |
| 1025 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1026 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1027 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1028 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1029 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1030 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1031 | 0 \ |
| 1032 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1033 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1034 | -S "server hello, adding encrypt then mac extension" \ |
| 1035 | -C "found encrypt_then_mac extension" \ |
| 1036 | -C "using encrypt then mac" \ |
| 1037 | -S "using encrypt then mac" |
| 1038 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1039 | # Tests for Extended Master Secret extension |
| 1040 | |
| 1041 | run_test "Extended Master Secret: default" \ |
| 1042 | "$P_SRV debug_level=3" \ |
| 1043 | "$P_CLI debug_level=3" \ |
| 1044 | 0 \ |
| 1045 | -c "client hello, adding extended_master_secret extension" \ |
| 1046 | -s "found extended master secret extension" \ |
| 1047 | -s "server hello, adding extended master secret extension" \ |
| 1048 | -c "found extended_master_secret extension" \ |
| 1049 | -c "using extended master secret" \ |
| 1050 | -s "using extended master secret" |
| 1051 | |
| 1052 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1053 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1054 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1055 | 0 \ |
| 1056 | -c "client hello, adding extended_master_secret extension" \ |
| 1057 | -s "found extended master secret extension" \ |
| 1058 | -S "server hello, adding extended master secret extension" \ |
| 1059 | -C "found extended_master_secret extension" \ |
| 1060 | -C "using extended master secret" \ |
| 1061 | -S "using extended master secret" |
| 1062 | |
| 1063 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1064 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1065 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1066 | 0 \ |
| 1067 | -C "client hello, adding extended_master_secret extension" \ |
| 1068 | -S "found extended master secret extension" \ |
| 1069 | -S "server hello, adding extended master secret extension" \ |
| 1070 | -C "found extended_master_secret extension" \ |
| 1071 | -C "using extended master secret" \ |
| 1072 | -S "using extended master secret" |
| 1073 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1074 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1075 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1076 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1077 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1078 | 0 \ |
| 1079 | -C "client hello, adding extended_master_secret extension" \ |
| 1080 | -S "found extended master secret extension" \ |
| 1081 | -S "server hello, adding extended master secret extension" \ |
| 1082 | -C "found extended_master_secret extension" \ |
| 1083 | -C "using extended master secret" \ |
| 1084 | -S "using extended master secret" |
| 1085 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1086 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1087 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1088 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1089 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1090 | 0 \ |
| 1091 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1092 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1093 | -S "server hello, adding extended master secret extension" \ |
| 1094 | -C "found extended_master_secret extension" \ |
| 1095 | -C "using extended master secret" \ |
| 1096 | -S "using extended master secret" |
| 1097 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1098 | # Tests for FALLBACK_SCSV |
| 1099 | |
| 1100 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1101 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1102 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1103 | 0 \ |
| 1104 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1105 | -S "received FALLBACK_SCSV" \ |
| 1106 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1107 | -C "is a fatal alert message (msg 86)" |
| 1108 | |
| 1109 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1110 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1111 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1112 | 0 \ |
| 1113 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1114 | -S "received FALLBACK_SCSV" \ |
| 1115 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1116 | -C "is a fatal alert message (msg 86)" |
| 1117 | |
| 1118 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1119 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1120 | "$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] | 1121 | 1 \ |
| 1122 | -c "adding FALLBACK_SCSV" \ |
| 1123 | -s "received FALLBACK_SCSV" \ |
| 1124 | -s "inapropriate fallback" \ |
| 1125 | -c "is a fatal alert message (msg 86)" |
| 1126 | |
| 1127 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1128 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1129 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1130 | 0 \ |
| 1131 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1132 | -s "received FALLBACK_SCSV" \ |
| 1133 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1134 | -C "is a fatal alert message (msg 86)" |
| 1135 | |
| 1136 | requires_openssl_with_fallback_scsv |
| 1137 | run_test "Fallback SCSV: default, openssl server" \ |
| 1138 | "$O_SRV" \ |
| 1139 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1140 | 0 \ |
| 1141 | -C "adding FALLBACK_SCSV" \ |
| 1142 | -C "is a fatal alert message (msg 86)" |
| 1143 | |
| 1144 | requires_openssl_with_fallback_scsv |
| 1145 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1146 | "$O_SRV" \ |
| 1147 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1148 | 1 \ |
| 1149 | -c "adding FALLBACK_SCSV" \ |
| 1150 | -c "is a fatal alert message (msg 86)" |
| 1151 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1152 | requires_openssl_with_fallback_scsv |
| 1153 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1154 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1155 | "$O_CLI -tls1_1" \ |
| 1156 | 0 \ |
| 1157 | -S "received FALLBACK_SCSV" \ |
| 1158 | -S "inapropriate fallback" |
| 1159 | |
| 1160 | requires_openssl_with_fallback_scsv |
| 1161 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1162 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1163 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1164 | 1 \ |
| 1165 | -s "received FALLBACK_SCSV" \ |
| 1166 | -s "inapropriate fallback" |
| 1167 | |
| 1168 | requires_openssl_with_fallback_scsv |
| 1169 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1170 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1171 | "$O_CLI -fallback_scsv" \ |
| 1172 | 0 \ |
| 1173 | -s "received FALLBACK_SCSV" \ |
| 1174 | -S "inapropriate fallback" |
| 1175 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1176 | # Test sending and receiving empty application data records |
| 1177 | |
| 1178 | run_test "Encrypt then MAC: empty application data record" \ |
| 1179 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1180 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1181 | 0 \ |
| 1182 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1183 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1184 | -c "0 bytes written in 1 fragments" |
| 1185 | |
| 1186 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1187 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1188 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1189 | 0 \ |
| 1190 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1191 | -c "0 bytes written in 1 fragments" |
| 1192 | |
| 1193 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1194 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1195 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1196 | 0 \ |
| 1197 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1198 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1199 | -c "0 bytes written in 1 fragments" |
| 1200 | |
| 1201 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1202 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1203 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1204 | 0 \ |
| 1205 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1206 | -c "0 bytes written in 1 fragments" |
| 1207 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1208 | ## ClientHello generated with |
| 1209 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1210 | ## then manually twiddling the ciphersuite list. |
| 1211 | ## The ClientHello content is spelled out below as a hex string as |
| 1212 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1213 | ## The expected response is an inappropriate_fallback alert. |
| 1214 | requires_openssl_with_fallback_scsv |
| 1215 | run_test "Fallback SCSV: beginning of list" \ |
| 1216 | "$P_SRV debug_level=2" \ |
| 1217 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1218 | 0 \ |
| 1219 | -s "received FALLBACK_SCSV" \ |
| 1220 | -s "inapropriate fallback" |
| 1221 | |
| 1222 | requires_openssl_with_fallback_scsv |
| 1223 | run_test "Fallback SCSV: end of list" \ |
| 1224 | "$P_SRV debug_level=2" \ |
| 1225 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1226 | 0 \ |
| 1227 | -s "received FALLBACK_SCSV" \ |
| 1228 | -s "inapropriate fallback" |
| 1229 | |
| 1230 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1231 | requires_openssl_with_fallback_scsv |
| 1232 | run_test "Fallback SCSV: not in list" \ |
| 1233 | "$P_SRV debug_level=2" \ |
| 1234 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1235 | 0 \ |
| 1236 | -S "received FALLBACK_SCSV" \ |
| 1237 | -S "inapropriate fallback" |
| 1238 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1239 | # Tests for CBC 1/n-1 record splitting |
| 1240 | |
| 1241 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1242 | "$P_SRV" \ |
| 1243 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1244 | request_size=123 force_version=tls1_2" \ |
| 1245 | 0 \ |
| 1246 | -s "Read from client: 123 bytes read" \ |
| 1247 | -S "Read from client: 1 bytes read" \ |
| 1248 | -S "122 bytes read" |
| 1249 | |
| 1250 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1251 | "$P_SRV" \ |
| 1252 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1253 | request_size=123 force_version=tls1_1" \ |
| 1254 | 0 \ |
| 1255 | -s "Read from client: 123 bytes read" \ |
| 1256 | -S "Read from client: 1 bytes read" \ |
| 1257 | -S "122 bytes read" |
| 1258 | |
| 1259 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1260 | "$P_SRV" \ |
| 1261 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1262 | request_size=123 force_version=tls1" \ |
| 1263 | 0 \ |
| 1264 | -S "Read from client: 123 bytes read" \ |
| 1265 | -s "Read from client: 1 bytes read" \ |
| 1266 | -s "122 bytes read" |
| 1267 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1268 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1269 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1270 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1271 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1272 | request_size=123 force_version=ssl3" \ |
| 1273 | 0 \ |
| 1274 | -S "Read from client: 123 bytes read" \ |
| 1275 | -s "Read from client: 1 bytes read" \ |
| 1276 | -s "122 bytes read" |
| 1277 | |
| 1278 | 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] | 1279 | "$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] | 1280 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1281 | request_size=123 force_version=tls1" \ |
| 1282 | 0 \ |
| 1283 | -s "Read from client: 123 bytes read" \ |
| 1284 | -S "Read from client: 1 bytes read" \ |
| 1285 | -S "122 bytes read" |
| 1286 | |
| 1287 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1288 | "$P_SRV" \ |
| 1289 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1290 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1291 | 0 \ |
| 1292 | -s "Read from client: 123 bytes read" \ |
| 1293 | -S "Read from client: 1 bytes read" \ |
| 1294 | -S "122 bytes read" |
| 1295 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1296 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1297 | "$P_SRV nbio=2" \ |
| 1298 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1299 | request_size=123 force_version=tls1" \ |
| 1300 | 0 \ |
| 1301 | -S "Read from client: 123 bytes read" \ |
| 1302 | -s "Read from client: 1 bytes read" \ |
| 1303 | -s "122 bytes read" |
| 1304 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1305 | # Tests for Session Tickets |
| 1306 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1307 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1308 | "$P_SRV debug_level=3 tickets=1" \ |
| 1309 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1310 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1311 | -c "client hello, adding session ticket extension" \ |
| 1312 | -s "found session ticket extension" \ |
| 1313 | -s "server hello, adding session ticket extension" \ |
| 1314 | -c "found session_ticket extension" \ |
| 1315 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1316 | -S "session successfully restored from cache" \ |
| 1317 | -s "session successfully restored from ticket" \ |
| 1318 | -s "a session has been resumed" \ |
| 1319 | -c "a session has been resumed" |
| 1320 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1321 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1322 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1323 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1324 | 0 \ |
| 1325 | -c "client hello, adding session ticket extension" \ |
| 1326 | -s "found session ticket extension" \ |
| 1327 | -s "server hello, adding session ticket extension" \ |
| 1328 | -c "found session_ticket extension" \ |
| 1329 | -c "parse new session ticket" \ |
| 1330 | -S "session successfully restored from cache" \ |
| 1331 | -s "session successfully restored from ticket" \ |
| 1332 | -s "a session has been resumed" \ |
| 1333 | -c "a session has been resumed" |
| 1334 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1335 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1336 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1337 | "$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] | 1338 | 0 \ |
| 1339 | -c "client hello, adding session ticket extension" \ |
| 1340 | -s "found session ticket extension" \ |
| 1341 | -s "server hello, adding session ticket extension" \ |
| 1342 | -c "found session_ticket extension" \ |
| 1343 | -c "parse new session ticket" \ |
| 1344 | -S "session successfully restored from cache" \ |
| 1345 | -S "session successfully restored from ticket" \ |
| 1346 | -S "a session has been resumed" \ |
| 1347 | -C "a session has been resumed" |
| 1348 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1349 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1350 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1351 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1352 | 0 \ |
| 1353 | -c "client hello, adding session ticket extension" \ |
| 1354 | -c "found session_ticket extension" \ |
| 1355 | -c "parse new session ticket" \ |
| 1356 | -c "a session has been resumed" |
| 1357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1358 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1359 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1360 | "( $O_CLI -sess_out $SESSION; \ |
| 1361 | $O_CLI -sess_in $SESSION; \ |
| 1362 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1363 | 0 \ |
| 1364 | -s "found session ticket extension" \ |
| 1365 | -s "server hello, adding session ticket extension" \ |
| 1366 | -S "session successfully restored from cache" \ |
| 1367 | -s "session successfully restored from ticket" \ |
| 1368 | -s "a session has been resumed" |
| 1369 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1370 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1371 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1372 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1373 | "$P_SRV debug_level=3 tickets=0" \ |
| 1374 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1375 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1376 | -c "client hello, adding session ticket extension" \ |
| 1377 | -s "found session ticket extension" \ |
| 1378 | -S "server hello, adding session ticket extension" \ |
| 1379 | -C "found session_ticket extension" \ |
| 1380 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1381 | -s "session successfully restored from cache" \ |
| 1382 | -S "session successfully restored from ticket" \ |
| 1383 | -s "a session has been resumed" \ |
| 1384 | -c "a session has been resumed" |
| 1385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1386 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1387 | "$P_SRV debug_level=3 tickets=1" \ |
| 1388 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1389 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1390 | -C "client hello, adding session ticket extension" \ |
| 1391 | -S "found session ticket extension" \ |
| 1392 | -S "server hello, adding session ticket extension" \ |
| 1393 | -C "found session_ticket extension" \ |
| 1394 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1395 | -s "session successfully restored from cache" \ |
| 1396 | -S "session successfully restored from ticket" \ |
| 1397 | -s "a session has been resumed" \ |
| 1398 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1400 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1401 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1402 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1403 | 0 \ |
| 1404 | -S "session successfully restored from cache" \ |
| 1405 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1406 | -S "a session has been resumed" \ |
| 1407 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1408 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1409 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1410 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1411 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1412 | 0 \ |
| 1413 | -s "session successfully restored from cache" \ |
| 1414 | -S "session successfully restored from ticket" \ |
| 1415 | -s "a session has been resumed" \ |
| 1416 | -c "a session has been resumed" |
| 1417 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1418 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1419 | "$P_SRV debug_level=3 tickets=0" \ |
| 1420 | "$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] | 1421 | 0 \ |
| 1422 | -s "session successfully restored from cache" \ |
| 1423 | -S "session successfully restored from ticket" \ |
| 1424 | -s "a session has been resumed" \ |
| 1425 | -c "a session has been resumed" |
| 1426 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1427 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1428 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1429 | "$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] | 1430 | 0 \ |
| 1431 | -S "session successfully restored from cache" \ |
| 1432 | -S "session successfully restored from ticket" \ |
| 1433 | -S "a session has been resumed" \ |
| 1434 | -C "a session has been resumed" |
| 1435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1436 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1437 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1438 | "$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] | 1439 | 0 \ |
| 1440 | -s "session successfully restored from cache" \ |
| 1441 | -S "session successfully restored from ticket" \ |
| 1442 | -s "a session has been resumed" \ |
| 1443 | -c "a session has been resumed" |
| 1444 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1445 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1446 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1447 | "( $O_CLI -sess_out $SESSION; \ |
| 1448 | $O_CLI -sess_in $SESSION; \ |
| 1449 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1450 | 0 \ |
| 1451 | -s "found session ticket extension" \ |
| 1452 | -S "server hello, adding session ticket extension" \ |
| 1453 | -s "session successfully restored from cache" \ |
| 1454 | -S "session successfully restored from ticket" \ |
| 1455 | -s "a session has been resumed" |
| 1456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1457 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1458 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1459 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1460 | 0 \ |
| 1461 | -C "found session_ticket extension" \ |
| 1462 | -C "parse new session ticket" \ |
| 1463 | -c "a session has been resumed" |
| 1464 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1465 | # Tests for Max Fragment Length extension |
| 1466 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1467 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1468 | 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] | 1469 | exit 1 |
| 1470 | fi |
| 1471 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1472 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1473 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1474 | fi |
| 1475 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1476 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1477 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1478 | "$P_SRV debug_level=3" \ |
| 1479 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1480 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1481 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1482 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1483 | -C "client hello, adding max_fragment_length extension" \ |
| 1484 | -S "found max fragment length extension" \ |
| 1485 | -S "server hello, max_fragment_length extension" \ |
| 1486 | -C "found max_fragment_length extension" |
| 1487 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1488 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1489 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1490 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1491 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1492 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1493 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1494 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1495 | -C "client hello, adding max_fragment_length extension" \ |
| 1496 | -S "found max fragment length extension" \ |
| 1497 | -S "server hello, max_fragment_length extension" \ |
| 1498 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1499 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1500 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1501 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1502 | |
| 1503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1504 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1505 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1506 | "$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] | 1507 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1508 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1509 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1510 | -C "client hello, adding max_fragment_length extension" \ |
| 1511 | -S "found max fragment length extension" \ |
| 1512 | -S "server hello, max_fragment_length extension" \ |
| 1513 | -C "found max_fragment_length extension" \ |
| 1514 | -c "fragment larger than.*maximum " |
| 1515 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1516 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1517 | # (session fragment length will be 16384 regardless of mbedtls |
| 1518 | # content length configuration.) |
| 1519 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1520 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1521 | run_test "Max fragment length: disabled, larger message" \ |
| 1522 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1523 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1524 | 0 \ |
| 1525 | -C "Maximum fragment length is 16384" \ |
| 1526 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1527 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1528 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1529 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1530 | |
| 1531 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1532 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1533 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1534 | "$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] | 1535 | 1 \ |
| 1536 | -C "Maximum fragment length is 16384" \ |
| 1537 | -S "Maximum fragment length is 16384" \ |
| 1538 | -c "fragment larger than.*maximum " |
| 1539 | |
| 1540 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1541 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1542 | "$P_SRV debug_level=3" \ |
| 1543 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1544 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1545 | -c "Maximum fragment length is 4096" \ |
| 1546 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1547 | -c "client hello, adding max_fragment_length extension" \ |
| 1548 | -s "found max fragment length extension" \ |
| 1549 | -s "server hello, max_fragment_length extension" \ |
| 1550 | -c "found max_fragment_length extension" |
| 1551 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1552 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1553 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1554 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1555 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1556 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1557 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1558 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1559 | -C "client hello, adding max_fragment_length extension" \ |
| 1560 | -S "found max fragment length extension" \ |
| 1561 | -S "server hello, max_fragment_length extension" \ |
| 1562 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1563 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1564 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1565 | requires_gnutls |
| 1566 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1567 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1568 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1569 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1570 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1571 | -c "client hello, adding max_fragment_length extension" \ |
| 1572 | -c "found max_fragment_length extension" |
| 1573 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1574 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1575 | run_test "Max fragment length: client, message just fits" \ |
| 1576 | "$P_SRV debug_level=3" \ |
| 1577 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1578 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1579 | -c "Maximum fragment length is 2048" \ |
| 1580 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1581 | -c "client hello, adding max_fragment_length extension" \ |
| 1582 | -s "found max fragment length extension" \ |
| 1583 | -s "server hello, max_fragment_length extension" \ |
| 1584 | -c "found max_fragment_length extension" \ |
| 1585 | -c "2048 bytes written in 1 fragments" \ |
| 1586 | -s "2048 bytes read" |
| 1587 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1588 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1589 | run_test "Max fragment length: client, larger message" \ |
| 1590 | "$P_SRV debug_level=3" \ |
| 1591 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1592 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1593 | -c "Maximum fragment length is 2048" \ |
| 1594 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1595 | -c "client hello, adding max_fragment_length extension" \ |
| 1596 | -s "found max fragment length extension" \ |
| 1597 | -s "server hello, max_fragment_length extension" \ |
| 1598 | -c "found max_fragment_length extension" \ |
| 1599 | -c "2345 bytes written in 2 fragments" \ |
| 1600 | -s "2048 bytes read" \ |
| 1601 | -s "297 bytes read" |
| 1602 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1603 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1604 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1605 | "$P_SRV debug_level=3 dtls=1" \ |
| 1606 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1607 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1608 | -c "Maximum fragment length is 2048" \ |
| 1609 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1610 | -c "client hello, adding max_fragment_length extension" \ |
| 1611 | -s "found max fragment length extension" \ |
| 1612 | -s "server hello, max_fragment_length extension" \ |
| 1613 | -c "found max_fragment_length extension" \ |
| 1614 | -c "fragment larger than.*maximum" |
| 1615 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1616 | # Tests for renegotiation |
| 1617 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1618 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1619 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1620 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1621 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1622 | 0 \ |
| 1623 | -C "client hello, adding renegotiation extension" \ |
| 1624 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1625 | -S "found renegotiation extension" \ |
| 1626 | -s "server hello, secure renegotiation extension" \ |
| 1627 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1628 | -C "=> renegotiate" \ |
| 1629 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1630 | -S "write hello request" |
| 1631 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1632 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1633 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1634 | "$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] | 1635 | "$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] | 1636 | 0 \ |
| 1637 | -c "client hello, adding renegotiation extension" \ |
| 1638 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1639 | -s "found renegotiation extension" \ |
| 1640 | -s "server hello, secure renegotiation extension" \ |
| 1641 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1642 | -c "=> renegotiate" \ |
| 1643 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1644 | -S "write hello request" |
| 1645 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1646 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1647 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1648 | "$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] | 1649 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1650 | 0 \ |
| 1651 | -c "client hello, adding renegotiation extension" \ |
| 1652 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1653 | -s "found renegotiation extension" \ |
| 1654 | -s "server hello, secure renegotiation extension" \ |
| 1655 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1656 | -c "=> renegotiate" \ |
| 1657 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1658 | -s "write hello request" |
| 1659 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1660 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1661 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1662 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1663 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1664 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1665 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1666 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1667 | 0 \ |
| 1668 | -c "client hello, adding renegotiation extension" \ |
| 1669 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1670 | -s "found renegotiation extension" \ |
| 1671 | -s "server hello, secure renegotiation extension" \ |
| 1672 | -c "found renegotiation extension" \ |
| 1673 | -c "=> renegotiate" \ |
| 1674 | -s "=> renegotiate" \ |
| 1675 | -S "write hello request" \ |
| 1676 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1677 | |
| 1678 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1679 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1680 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1682 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1683 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1684 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1685 | 0 \ |
| 1686 | -c "client hello, adding renegotiation extension" \ |
| 1687 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1688 | -s "found renegotiation extension" \ |
| 1689 | -s "server hello, secure renegotiation extension" \ |
| 1690 | -c "found renegotiation extension" \ |
| 1691 | -c "=> renegotiate" \ |
| 1692 | -s "=> renegotiate" \ |
| 1693 | -s "write hello request" \ |
| 1694 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1695 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1696 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1697 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1698 | "$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] | 1699 | "$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] | 1700 | 0 \ |
| 1701 | -c "client hello, adding renegotiation extension" \ |
| 1702 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1703 | -s "found renegotiation extension" \ |
| 1704 | -s "server hello, secure renegotiation extension" \ |
| 1705 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1706 | -c "=> renegotiate" \ |
| 1707 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1708 | -s "write hello request" |
| 1709 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1710 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1711 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1712 | "$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] | 1713 | "$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] | 1714 | 1 \ |
| 1715 | -c "client hello, adding renegotiation extension" \ |
| 1716 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1717 | -S "found renegotiation extension" \ |
| 1718 | -s "server hello, secure renegotiation extension" \ |
| 1719 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1720 | -c "=> renegotiate" \ |
| 1721 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1722 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1723 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1724 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1725 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1726 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1727 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1728 | "$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] | 1729 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1730 | 0 \ |
| 1731 | -C "client hello, adding renegotiation extension" \ |
| 1732 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1733 | -S "found renegotiation extension" \ |
| 1734 | -s "server hello, secure renegotiation extension" \ |
| 1735 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1736 | -C "=> renegotiate" \ |
| 1737 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1738 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1739 | -S "SSL - An unexpected message was received from our peer" \ |
| 1740 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1741 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1742 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1743 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1744 | "$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] | 1745 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1746 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1747 | 0 \ |
| 1748 | -C "client hello, adding renegotiation extension" \ |
| 1749 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1750 | -S "found renegotiation extension" \ |
| 1751 | -s "server hello, secure renegotiation extension" \ |
| 1752 | -c "found renegotiation extension" \ |
| 1753 | -C "=> renegotiate" \ |
| 1754 | -S "=> renegotiate" \ |
| 1755 | -s "write hello request" \ |
| 1756 | -S "SSL - An unexpected message was received from our peer" \ |
| 1757 | -S "failed" |
| 1758 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1759 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1760 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1761 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1762 | "$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] | 1763 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1764 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1765 | 0 \ |
| 1766 | -C "client hello, adding renegotiation extension" \ |
| 1767 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1768 | -S "found renegotiation extension" \ |
| 1769 | -s "server hello, secure renegotiation extension" \ |
| 1770 | -c "found renegotiation extension" \ |
| 1771 | -C "=> renegotiate" \ |
| 1772 | -S "=> renegotiate" \ |
| 1773 | -s "write hello request" \ |
| 1774 | -S "SSL - An unexpected message was received from our peer" \ |
| 1775 | -S "failed" |
| 1776 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1777 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1778 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1779 | "$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] | 1780 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1781 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1782 | 0 \ |
| 1783 | -C "client hello, adding renegotiation extension" \ |
| 1784 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1785 | -S "found renegotiation extension" \ |
| 1786 | -s "server hello, secure renegotiation extension" \ |
| 1787 | -c "found renegotiation extension" \ |
| 1788 | -C "=> renegotiate" \ |
| 1789 | -S "=> renegotiate" \ |
| 1790 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1791 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1792 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1794 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1795 | "$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] | 1796 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1797 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1798 | 0 \ |
| 1799 | -c "client hello, adding renegotiation extension" \ |
| 1800 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1801 | -s "found renegotiation extension" \ |
| 1802 | -s "server hello, secure renegotiation extension" \ |
| 1803 | -c "found renegotiation extension" \ |
| 1804 | -c "=> renegotiate" \ |
| 1805 | -s "=> renegotiate" \ |
| 1806 | -s "write hello request" \ |
| 1807 | -S "SSL - An unexpected message was received from our peer" \ |
| 1808 | -S "failed" |
| 1809 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1810 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1811 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1812 | "$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] | 1813 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1814 | 0 \ |
| 1815 | -C "client hello, adding renegotiation extension" \ |
| 1816 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1817 | -S "found renegotiation extension" \ |
| 1818 | -s "server hello, secure renegotiation extension" \ |
| 1819 | -c "found renegotiation extension" \ |
| 1820 | -S "record counter limit reached: renegotiate" \ |
| 1821 | -C "=> renegotiate" \ |
| 1822 | -S "=> renegotiate" \ |
| 1823 | -S "write hello request" \ |
| 1824 | -S "SSL - An unexpected message was received from our peer" \ |
| 1825 | -S "failed" |
| 1826 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1827 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1828 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1829 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1830 | "$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] | 1831 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1832 | 0 \ |
| 1833 | -c "client hello, adding renegotiation extension" \ |
| 1834 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1835 | -s "found renegotiation extension" \ |
| 1836 | -s "server hello, secure renegotiation extension" \ |
| 1837 | -c "found renegotiation extension" \ |
| 1838 | -s "record counter limit reached: renegotiate" \ |
| 1839 | -c "=> renegotiate" \ |
| 1840 | -s "=> renegotiate" \ |
| 1841 | -s "write hello request" \ |
| 1842 | -S "SSL - An unexpected message was received from our peer" \ |
| 1843 | -S "failed" |
| 1844 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1845 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1846 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1847 | "$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] | 1848 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1849 | 0 \ |
| 1850 | -c "client hello, adding renegotiation extension" \ |
| 1851 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1852 | -s "found renegotiation extension" \ |
| 1853 | -s "server hello, secure renegotiation extension" \ |
| 1854 | -c "found renegotiation extension" \ |
| 1855 | -s "record counter limit reached: renegotiate" \ |
| 1856 | -c "=> renegotiate" \ |
| 1857 | -s "=> renegotiate" \ |
| 1858 | -s "write hello request" \ |
| 1859 | -S "SSL - An unexpected message was received from our peer" \ |
| 1860 | -S "failed" |
| 1861 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1863 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1864 | "$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] | 1865 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1866 | 0 \ |
| 1867 | -C "client hello, adding renegotiation extension" \ |
| 1868 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1869 | -S "found renegotiation extension" \ |
| 1870 | -s "server hello, secure renegotiation extension" \ |
| 1871 | -c "found renegotiation extension" \ |
| 1872 | -S "record counter limit reached: renegotiate" \ |
| 1873 | -C "=> renegotiate" \ |
| 1874 | -S "=> renegotiate" \ |
| 1875 | -S "write hello request" \ |
| 1876 | -S "SSL - An unexpected message was received from our peer" \ |
| 1877 | -S "failed" |
| 1878 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1880 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1881 | "$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] | 1882 | "$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] | 1883 | 0 \ |
| 1884 | -c "client hello, adding renegotiation extension" \ |
| 1885 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1886 | -s "found renegotiation extension" \ |
| 1887 | -s "server hello, secure renegotiation extension" \ |
| 1888 | -c "found renegotiation extension" \ |
| 1889 | -c "=> renegotiate" \ |
| 1890 | -s "=> renegotiate" \ |
| 1891 | -S "write hello request" |
| 1892 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1893 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1894 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1895 | "$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] | 1896 | "$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] | 1897 | 0 \ |
| 1898 | -c "client hello, adding renegotiation extension" \ |
| 1899 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1900 | -s "found renegotiation extension" \ |
| 1901 | -s "server hello, secure renegotiation extension" \ |
| 1902 | -c "found renegotiation extension" \ |
| 1903 | -c "=> renegotiate" \ |
| 1904 | -s "=> renegotiate" \ |
| 1905 | -s "write hello request" |
| 1906 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1907 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1908 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1909 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1910 | "$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] | 1911 | 0 \ |
| 1912 | -c "client hello, adding renegotiation extension" \ |
| 1913 | -c "found renegotiation extension" \ |
| 1914 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1915 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1916 | -C "error" \ |
| 1917 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1918 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1919 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1920 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1921 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1922 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1923 | "$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] | 1924 | 0 \ |
| 1925 | -c "client hello, adding renegotiation extension" \ |
| 1926 | -c "found renegotiation extension" \ |
| 1927 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1928 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1929 | -C "error" \ |
| 1930 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1931 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1932 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1934 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1935 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1936 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1937 | 1 \ |
| 1938 | -c "client hello, adding renegotiation extension" \ |
| 1939 | -C "found renegotiation extension" \ |
| 1940 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1941 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1942 | -c "error" \ |
| 1943 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1944 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1945 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1946 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1947 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1948 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1949 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1950 | allow_legacy=0" \ |
| 1951 | 1 \ |
| 1952 | -c "client hello, adding renegotiation extension" \ |
| 1953 | -C "found renegotiation extension" \ |
| 1954 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1955 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1956 | -c "error" \ |
| 1957 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1958 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1959 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1960 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1961 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1962 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1963 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1964 | allow_legacy=1" \ |
| 1965 | 0 \ |
| 1966 | -c "client hello, adding renegotiation extension" \ |
| 1967 | -C "found renegotiation extension" \ |
| 1968 | -c "=> renegotiate" \ |
| 1969 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1970 | -C "error" \ |
| 1971 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1972 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1974 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1975 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1976 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1977 | 0 \ |
| 1978 | -c "client hello, adding renegotiation extension" \ |
| 1979 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1980 | -s "found renegotiation extension" \ |
| 1981 | -s "server hello, secure renegotiation extension" \ |
| 1982 | -c "found renegotiation extension" \ |
| 1983 | -c "=> renegotiate" \ |
| 1984 | -s "=> renegotiate" \ |
| 1985 | -S "write hello request" |
| 1986 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1987 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1988 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1989 | "$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] | 1990 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1991 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1992 | 0 \ |
| 1993 | -c "client hello, adding renegotiation extension" \ |
| 1994 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1995 | -s "found renegotiation extension" \ |
| 1996 | -s "server hello, secure renegotiation extension" \ |
| 1997 | -c "found renegotiation extension" \ |
| 1998 | -c "=> renegotiate" \ |
| 1999 | -s "=> renegotiate" \ |
| 2000 | -s "write hello request" |
| 2001 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2002 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2003 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2004 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2005 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2006 | 0 \ |
| 2007 | -c "client hello, adding renegotiation extension" \ |
| 2008 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2009 | -s "found renegotiation extension" \ |
| 2010 | -s "server hello, secure renegotiation extension" \ |
| 2011 | -s "record counter limit reached: renegotiate" \ |
| 2012 | -c "=> renegotiate" \ |
| 2013 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2014 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2015 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2016 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2017 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2018 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2019 | "$G_SRV -u --mtu 4096" \ |
| 2020 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2021 | 0 \ |
| 2022 | -c "client hello, adding renegotiation extension" \ |
| 2023 | -c "found renegotiation extension" \ |
| 2024 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2025 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2026 | -C "error" \ |
| 2027 | -s "Extra-header:" |
| 2028 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2029 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2030 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2031 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2032 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2033 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2034 | "$P_CLI debug_level=3" \ |
| 2035 | 0 \ |
| 2036 | -c "found renegotiation extension" \ |
| 2037 | -C "error" \ |
| 2038 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2039 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2040 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2041 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2042 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2043 | "$P_CLI debug_level=3" \ |
| 2044 | 0 \ |
| 2045 | -C "found renegotiation extension" \ |
| 2046 | -C "error" \ |
| 2047 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2048 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2049 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2050 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2051 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2052 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2053 | 1 \ |
| 2054 | -C "found renegotiation extension" \ |
| 2055 | -c "error" \ |
| 2056 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2057 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2058 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2059 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2060 | "$P_SRV debug_level=3" \ |
| 2061 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2062 | 0 \ |
| 2063 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2064 | -s "server hello, secure renegotiation extension" |
| 2065 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2066 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2067 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2068 | "$P_SRV debug_level=3" \ |
| 2069 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2070 | 0 \ |
| 2071 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2072 | -S "server hello, secure renegotiation extension" |
| 2073 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2074 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2075 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2076 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 2077 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2078 | 1 \ |
| 2079 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2080 | -S "server hello, secure renegotiation extension" |
| 2081 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2082 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2083 | |
| 2084 | requires_gnutls |
| 2085 | run_test "DER format: no trailing bytes" \ |
| 2086 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2087 | key_file=data_files/server5.key" \ |
| 2088 | "$G_CLI " \ |
| 2089 | 0 \ |
| 2090 | -c "Handshake was completed" \ |
| 2091 | |
| 2092 | requires_gnutls |
| 2093 | run_test "DER format: with a trailing zero byte" \ |
| 2094 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2095 | key_file=data_files/server5.key" \ |
| 2096 | "$G_CLI " \ |
| 2097 | 0 \ |
| 2098 | -c "Handshake was completed" \ |
| 2099 | |
| 2100 | requires_gnutls |
| 2101 | run_test "DER format: with a trailing random byte" \ |
| 2102 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2103 | key_file=data_files/server5.key" \ |
| 2104 | "$G_CLI " \ |
| 2105 | 0 \ |
| 2106 | -c "Handshake was completed" \ |
| 2107 | |
| 2108 | requires_gnutls |
| 2109 | run_test "DER format: with 2 trailing random bytes" \ |
| 2110 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2111 | key_file=data_files/server5.key" \ |
| 2112 | "$G_CLI " \ |
| 2113 | 0 \ |
| 2114 | -c "Handshake was completed" \ |
| 2115 | |
| 2116 | requires_gnutls |
| 2117 | run_test "DER format: with 4 trailing random bytes" \ |
| 2118 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2119 | key_file=data_files/server5.key" \ |
| 2120 | "$G_CLI " \ |
| 2121 | 0 \ |
| 2122 | -c "Handshake was completed" \ |
| 2123 | |
| 2124 | requires_gnutls |
| 2125 | run_test "DER format: with 8 trailing random bytes" \ |
| 2126 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2127 | key_file=data_files/server5.key" \ |
| 2128 | "$G_CLI " \ |
| 2129 | 0 \ |
| 2130 | -c "Handshake was completed" \ |
| 2131 | |
| 2132 | requires_gnutls |
| 2133 | run_test "DER format: with 9 trailing random bytes" \ |
| 2134 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2135 | key_file=data_files/server5.key" \ |
| 2136 | "$G_CLI " \ |
| 2137 | 0 \ |
| 2138 | -c "Handshake was completed" \ |
| 2139 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2140 | # Tests for auth_mode |
| 2141 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2142 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2143 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2144 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2145 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2146 | 1 \ |
| 2147 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2148 | -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] | 2149 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2150 | -c "X509 - Certificate verification failed" |
| 2151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2152 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2153 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2154 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2155 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2156 | 0 \ |
| 2157 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2158 | -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] | 2159 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2160 | -C "X509 - Certificate verification failed" |
| 2161 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2162 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2163 | "$P_SRV" \ |
| 2164 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2165 | 0 \ |
| 2166 | -c "x509_verify_cert() returned" \ |
| 2167 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2168 | -c "! Certificate verification flags"\ |
| 2169 | -C "! mbedtls_ssl_handshake returned" \ |
| 2170 | -C "X509 - Certificate verification failed" \ |
| 2171 | -C "SSL - No CA Chain is set, but required to operate" |
| 2172 | |
| 2173 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2174 | "$P_SRV" \ |
| 2175 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2176 | 1 \ |
| 2177 | -c "x509_verify_cert() returned" \ |
| 2178 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2179 | -c "! Certificate verification flags"\ |
| 2180 | -c "! mbedtls_ssl_handshake returned" \ |
| 2181 | -c "SSL - No CA Chain is set, but required to operate" |
| 2182 | |
| 2183 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2184 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2185 | # the client informs the server about the supported curves - it does, though, in the |
| 2186 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2187 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2188 | # different means to have the server ignoring the client's supported curve list. |
| 2189 | |
| 2190 | requires_config_enabled MBEDTLS_ECP_C |
| 2191 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2192 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2193 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2194 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2195 | 1 \ |
| 2196 | -c "bad certificate (EC key curve)"\ |
| 2197 | -c "! Certificate verification flags"\ |
| 2198 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2199 | |
| 2200 | requires_config_enabled MBEDTLS_ECP_C |
| 2201 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2202 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2203 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2204 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2205 | 1 \ |
| 2206 | -c "bad certificate (EC key curve)"\ |
| 2207 | -c "! Certificate verification flags"\ |
| 2208 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2209 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2210 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2211 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2212 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2213 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2214 | 0 \ |
| 2215 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2216 | -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] | 2217 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2218 | -C "X509 - Certificate verification failed" |
| 2219 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2220 | run_test "Authentication: client SHA256, server required" \ |
| 2221 | "$P_SRV auth_mode=required" \ |
| 2222 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2223 | key_file=data_files/server6.key \ |
| 2224 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2225 | 0 \ |
| 2226 | -c "Supported Signature Algorithm found: 4," \ |
| 2227 | -c "Supported Signature Algorithm found: 5," |
| 2228 | |
| 2229 | run_test "Authentication: client SHA384, server required" \ |
| 2230 | "$P_SRV auth_mode=required" \ |
| 2231 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2232 | key_file=data_files/server6.key \ |
| 2233 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2234 | 0 \ |
| 2235 | -c "Supported Signature Algorithm found: 4," \ |
| 2236 | -c "Supported Signature Algorithm found: 5," |
| 2237 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2238 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2239 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2240 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2241 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2242 | key_file=data_files/server5.key" \ |
| 2243 | 1 \ |
| 2244 | -S "skip write certificate request" \ |
| 2245 | -C "skip parse certificate request" \ |
| 2246 | -c "got a certificate request" \ |
| 2247 | -c "got no certificate to send" \ |
| 2248 | -S "x509_verify_cert() returned" \ |
| 2249 | -s "client has no certificate" \ |
| 2250 | -s "! mbedtls_ssl_handshake returned" \ |
| 2251 | -c "! mbedtls_ssl_handshake returned" \ |
| 2252 | -s "No client certification received from the client, but required by the authentication mode" |
| 2253 | |
| 2254 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2255 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2256 | "$P_CLI debug_level=3 crt_file=none \ |
| 2257 | key_file=data_files/server5.key" \ |
| 2258 | 1 \ |
| 2259 | -S "skip write certificate request" \ |
| 2260 | -C "skip parse certificate request" \ |
| 2261 | -c "got a certificate request" \ |
| 2262 | -c "= write certificate$" \ |
| 2263 | -C "skip write certificate$" \ |
| 2264 | -S "x509_verify_cert() returned" \ |
| 2265 | -s "client has no certificate" \ |
| 2266 | -s "! mbedtls_ssl_handshake returned" \ |
| 2267 | -c "! mbedtls_ssl_handshake returned" \ |
| 2268 | -s "No client certification received from the client, but required by the authentication mode" |
| 2269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2270 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2271 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2272 | "$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] | 2273 | key_file=data_files/server5.key" \ |
| 2274 | 1 \ |
| 2275 | -S "skip write certificate request" \ |
| 2276 | -C "skip parse certificate request" \ |
| 2277 | -c "got a certificate request" \ |
| 2278 | -C "skip write certificate" \ |
| 2279 | -C "skip write certificate verify" \ |
| 2280 | -S "skip parse certificate verify" \ |
| 2281 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2282 | -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] | 2283 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2284 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2285 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2286 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2287 | # We don't check that the client receives the alert because it might |
| 2288 | # detect that its write end of the connection is closed and abort |
| 2289 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2290 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2291 | run_test "Authentication: client cert not trusted, server required" \ |
| 2292 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2293 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2294 | key_file=data_files/server5.key" \ |
| 2295 | 1 \ |
| 2296 | -S "skip write certificate request" \ |
| 2297 | -C "skip parse certificate request" \ |
| 2298 | -c "got a certificate request" \ |
| 2299 | -C "skip write certificate" \ |
| 2300 | -C "skip write certificate verify" \ |
| 2301 | -S "skip parse certificate verify" \ |
| 2302 | -s "x509_verify_cert() returned" \ |
| 2303 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2304 | -s "! mbedtls_ssl_handshake returned" \ |
| 2305 | -c "! mbedtls_ssl_handshake returned" \ |
| 2306 | -s "X509 - Certificate verification failed" |
| 2307 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2308 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2309 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2310 | "$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] | 2311 | key_file=data_files/server5.key" \ |
| 2312 | 0 \ |
| 2313 | -S "skip write certificate request" \ |
| 2314 | -C "skip parse certificate request" \ |
| 2315 | -c "got a certificate request" \ |
| 2316 | -C "skip write certificate" \ |
| 2317 | -C "skip write certificate verify" \ |
| 2318 | -S "skip parse certificate verify" \ |
| 2319 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2320 | -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] | 2321 | -S "! mbedtls_ssl_handshake returned" \ |
| 2322 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2323 | -S "X509 - Certificate verification failed" |
| 2324 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2325 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2326 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2327 | "$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] | 2328 | key_file=data_files/server5.key" \ |
| 2329 | 0 \ |
| 2330 | -s "skip write certificate request" \ |
| 2331 | -C "skip parse certificate request" \ |
| 2332 | -c "got no certificate request" \ |
| 2333 | -c "skip write certificate" \ |
| 2334 | -c "skip write certificate verify" \ |
| 2335 | -s "skip parse certificate verify" \ |
| 2336 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2337 | -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] | 2338 | -S "! mbedtls_ssl_handshake returned" \ |
| 2339 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2340 | -S "X509 - Certificate verification failed" |
| 2341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2342 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2343 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2344 | "$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] | 2345 | 0 \ |
| 2346 | -S "skip write certificate request" \ |
| 2347 | -C "skip parse certificate request" \ |
| 2348 | -c "got a certificate request" \ |
| 2349 | -C "skip write certificate$" \ |
| 2350 | -C "got no certificate to send" \ |
| 2351 | -S "SSLv3 client has no certificate" \ |
| 2352 | -c "skip write certificate verify" \ |
| 2353 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2354 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2355 | -S "! mbedtls_ssl_handshake returned" \ |
| 2356 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2357 | -S "X509 - Certificate verification failed" |
| 2358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2359 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2360 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2361 | "$O_CLI" \ |
| 2362 | 0 \ |
| 2363 | -S "skip write certificate request" \ |
| 2364 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2365 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2366 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2367 | -S "X509 - Certificate verification failed" |
| 2368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2369 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2370 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2371 | "$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] | 2372 | 0 \ |
| 2373 | -C "skip parse certificate request" \ |
| 2374 | -c "got a certificate request" \ |
| 2375 | -C "skip write certificate$" \ |
| 2376 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2377 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2378 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2379 | run_test "Authentication: client no cert, openssl server required" \ |
| 2380 | "$O_SRV -Verify 10" \ |
| 2381 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2382 | 1 \ |
| 2383 | -C "skip parse certificate request" \ |
| 2384 | -c "got a certificate request" \ |
| 2385 | -C "skip write certificate$" \ |
| 2386 | -c "skip write certificate verify" \ |
| 2387 | -c "! mbedtls_ssl_handshake returned" |
| 2388 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2390 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2391 | "$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] | 2392 | "$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] | 2393 | 0 \ |
| 2394 | -S "skip write certificate request" \ |
| 2395 | -C "skip parse certificate request" \ |
| 2396 | -c "got a certificate request" \ |
| 2397 | -C "skip write certificate$" \ |
| 2398 | -c "skip write certificate verify" \ |
| 2399 | -c "got no certificate to send" \ |
| 2400 | -s "SSLv3 client has no certificate" \ |
| 2401 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2402 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2403 | -S "! mbedtls_ssl_handshake returned" \ |
| 2404 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2405 | -S "X509 - Certificate verification failed" |
| 2406 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2407 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2408 | # default value (8) |
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 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2411 | 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] | 2412 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2413 | 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] | 2414 | 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] | 2415 | 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] | 2416 | printf "test value of ${MAX_IM_CA}. \n" |
| 2417 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2418 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2419 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2420 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2421 | |
| 2422 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2423 | fi |
| 2424 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2425 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2426 | run_test "Authentication: server max_int chain, client default" \ |
| 2427 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2428 | key_file=data_files/dir-maxpath/09.key" \ |
| 2429 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2430 | 0 \ |
| 2431 | -C "X509 - A fatal error occured" |
| 2432 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2433 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2434 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2435 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2436 | key_file=data_files/dir-maxpath/10.key" \ |
| 2437 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2438 | 1 \ |
| 2439 | -c "X509 - A fatal error occured" |
| 2440 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2441 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2442 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2443 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2444 | key_file=data_files/dir-maxpath/10.key" \ |
| 2445 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2446 | auth_mode=optional" \ |
| 2447 | 1 \ |
| 2448 | -c "X509 - A fatal error occured" |
| 2449 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2450 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2451 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2452 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2453 | key_file=data_files/dir-maxpath/10.key" \ |
| 2454 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2455 | auth_mode=none" \ |
| 2456 | 0 \ |
| 2457 | -C "X509 - A fatal error occured" |
| 2458 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2459 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2460 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2461 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2462 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2463 | key_file=data_files/dir-maxpath/10.key" \ |
| 2464 | 0 \ |
| 2465 | -S "X509 - A fatal error occured" |
| 2466 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2467 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2468 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2469 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2470 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2471 | key_file=data_files/dir-maxpath/10.key" \ |
| 2472 | 1 \ |
| 2473 | -s "X509 - A fatal error occured" |
| 2474 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2475 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2476 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2477 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2478 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2479 | key_file=data_files/dir-maxpath/10.key" \ |
| 2480 | 1 \ |
| 2481 | -s "X509 - A fatal error occured" |
| 2482 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2483 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2484 | run_test "Authentication: client max_int chain, server required" \ |
| 2485 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2486 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2487 | key_file=data_files/dir-maxpath/09.key" \ |
| 2488 | 0 \ |
| 2489 | -S "X509 - A fatal error occured" |
| 2490 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2491 | # Tests for CA list in CertificateRequest messages |
| 2492 | |
| 2493 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2494 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2495 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2496 | key_file=data_files/server6.key" \ |
| 2497 | 0 \ |
| 2498 | -s "requested DN" |
| 2499 | |
| 2500 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2501 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2502 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2503 | key_file=data_files/server6.key" \ |
| 2504 | 0 \ |
| 2505 | -S "requested DN" |
| 2506 | |
| 2507 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2508 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2509 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2510 | key_file=data_files/server5.key" \ |
| 2511 | 1 \ |
| 2512 | -S "requested DN" \ |
| 2513 | -s "x509_verify_cert() returned" \ |
| 2514 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2515 | -s "! mbedtls_ssl_handshake returned" \ |
| 2516 | -c "! mbedtls_ssl_handshake returned" \ |
| 2517 | -s "X509 - Certificate verification failed" |
| 2518 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2519 | # Tests for certificate selection based on SHA verson |
| 2520 | |
| 2521 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2522 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2523 | key_file=data_files/server5.key \ |
| 2524 | crt_file2=data_files/server5-sha1.crt \ |
| 2525 | key_file2=data_files/server5.key" \ |
| 2526 | "$P_CLI force_version=tls1_2" \ |
| 2527 | 0 \ |
| 2528 | -c "signed using.*ECDSA with SHA256" \ |
| 2529 | -C "signed using.*ECDSA with SHA1" |
| 2530 | |
| 2531 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2532 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2533 | key_file=data_files/server5.key \ |
| 2534 | crt_file2=data_files/server5-sha1.crt \ |
| 2535 | key_file2=data_files/server5.key" \ |
| 2536 | "$P_CLI force_version=tls1_1" \ |
| 2537 | 0 \ |
| 2538 | -C "signed using.*ECDSA with SHA256" \ |
| 2539 | -c "signed using.*ECDSA with SHA1" |
| 2540 | |
| 2541 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2542 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2543 | key_file=data_files/server5.key \ |
| 2544 | crt_file2=data_files/server5-sha1.crt \ |
| 2545 | key_file2=data_files/server5.key" \ |
| 2546 | "$P_CLI force_version=tls1" \ |
| 2547 | 0 \ |
| 2548 | -C "signed using.*ECDSA with SHA256" \ |
| 2549 | -c "signed using.*ECDSA with SHA1" |
| 2550 | |
| 2551 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2552 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2553 | key_file=data_files/server5.key \ |
| 2554 | crt_file2=data_files/server6.crt \ |
| 2555 | key_file2=data_files/server6.key" \ |
| 2556 | "$P_CLI force_version=tls1_1" \ |
| 2557 | 0 \ |
| 2558 | -c "serial number.*09" \ |
| 2559 | -c "signed using.*ECDSA with SHA256" \ |
| 2560 | -C "signed using.*ECDSA with SHA1" |
| 2561 | |
| 2562 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2563 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2564 | key_file=data_files/server6.key \ |
| 2565 | crt_file2=data_files/server5.crt \ |
| 2566 | key_file2=data_files/server5.key" \ |
| 2567 | "$P_CLI force_version=tls1_1" \ |
| 2568 | 0 \ |
| 2569 | -c "serial number.*0A" \ |
| 2570 | -c "signed using.*ECDSA with SHA256" \ |
| 2571 | -C "signed using.*ECDSA with SHA1" |
| 2572 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2573 | # tests for SNI |
| 2574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2575 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2576 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2577 | 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] | 2578 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2579 | 0 \ |
| 2580 | -S "parse ServerName extension" \ |
| 2581 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2582 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2583 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2584 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2585 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2586 | 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] | 2587 | 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] | 2588 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2589 | 0 \ |
| 2590 | -s "parse ServerName extension" \ |
| 2591 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2592 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2594 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2595 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2596 | 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] | 2597 | 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] | 2598 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2599 | 0 \ |
| 2600 | -s "parse ServerName extension" \ |
| 2601 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2602 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2603 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2604 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2605 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2606 | 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] | 2607 | 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] | 2608 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2609 | 1 \ |
| 2610 | -s "parse ServerName extension" \ |
| 2611 | -s "ssl_sni_wrapper() returned" \ |
| 2612 | -s "mbedtls_ssl_handshake returned" \ |
| 2613 | -c "mbedtls_ssl_handshake returned" \ |
| 2614 | -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] | 2615 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2616 | run_test "SNI: client auth no override: optional" \ |
| 2617 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2618 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2619 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2620 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2621 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2622 | -S "skip write certificate request" \ |
| 2623 | -C "skip parse certificate request" \ |
| 2624 | -c "got a certificate request" \ |
| 2625 | -C "skip write certificate" \ |
| 2626 | -C "skip write certificate verify" \ |
| 2627 | -S "skip parse certificate verify" |
| 2628 | |
| 2629 | run_test "SNI: client auth override: none -> optional" \ |
| 2630 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2631 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2632 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2633 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2634 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2635 | -S "skip write certificate request" \ |
| 2636 | -C "skip parse certificate request" \ |
| 2637 | -c "got a certificate request" \ |
| 2638 | -C "skip write certificate" \ |
| 2639 | -C "skip write certificate verify" \ |
| 2640 | -S "skip parse certificate verify" |
| 2641 | |
| 2642 | run_test "SNI: client auth override: optional -> none" \ |
| 2643 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2644 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2645 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2646 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2647 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2648 | -s "skip write certificate request" \ |
| 2649 | -C "skip parse certificate request" \ |
| 2650 | -c "got no certificate request" \ |
| 2651 | -c "skip write certificate" \ |
| 2652 | -c "skip write certificate verify" \ |
| 2653 | -s "skip parse certificate verify" |
| 2654 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2655 | run_test "SNI: CA no override" \ |
| 2656 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2657 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2658 | ca_file=data_files/test-ca.crt \ |
| 2659 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2660 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2661 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2662 | 1 \ |
| 2663 | -S "skip write certificate request" \ |
| 2664 | -C "skip parse certificate request" \ |
| 2665 | -c "got a certificate request" \ |
| 2666 | -C "skip write certificate" \ |
| 2667 | -C "skip write certificate verify" \ |
| 2668 | -S "skip parse certificate verify" \ |
| 2669 | -s "x509_verify_cert() returned" \ |
| 2670 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2671 | -S "The certificate has been revoked (is on a CRL)" |
| 2672 | |
| 2673 | run_test "SNI: CA override" \ |
| 2674 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2675 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2676 | ca_file=data_files/test-ca.crt \ |
| 2677 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2678 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2679 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2680 | 0 \ |
| 2681 | -S "skip write certificate request" \ |
| 2682 | -C "skip parse certificate request" \ |
| 2683 | -c "got a certificate request" \ |
| 2684 | -C "skip write certificate" \ |
| 2685 | -C "skip write certificate verify" \ |
| 2686 | -S "skip parse certificate verify" \ |
| 2687 | -S "x509_verify_cert() returned" \ |
| 2688 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2689 | -S "The certificate has been revoked (is on a CRL)" |
| 2690 | |
| 2691 | run_test "SNI: CA override with CRL" \ |
| 2692 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2693 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2694 | ca_file=data_files/test-ca.crt \ |
| 2695 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2696 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2697 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2698 | 1 \ |
| 2699 | -S "skip write certificate request" \ |
| 2700 | -C "skip parse certificate request" \ |
| 2701 | -c "got a certificate request" \ |
| 2702 | -C "skip write certificate" \ |
| 2703 | -C "skip write certificate verify" \ |
| 2704 | -S "skip parse certificate verify" \ |
| 2705 | -s "x509_verify_cert() returned" \ |
| 2706 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2707 | -s "The certificate has been revoked (is on a CRL)" |
| 2708 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2709 | # Tests for SNI and DTLS |
| 2710 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2711 | run_test "SNI: DTLS, no SNI callback" \ |
| 2712 | "$P_SRV debug_level=3 dtls=1 \ |
| 2713 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2714 | "$P_CLI server_name=localhost dtls=1" \ |
| 2715 | 0 \ |
| 2716 | -S "parse ServerName extension" \ |
| 2717 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2718 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2719 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2720 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2721 | "$P_SRV debug_level=3 dtls=1 \ |
| 2722 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2723 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2724 | "$P_CLI server_name=localhost dtls=1" \ |
| 2725 | 0 \ |
| 2726 | -s "parse ServerName extension" \ |
| 2727 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2728 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2729 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2730 | run_test "SNI: DTLS, matching cert 2" \ |
| 2731 | "$P_SRV debug_level=3 dtls=1 \ |
| 2732 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2733 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2734 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2735 | 0 \ |
| 2736 | -s "parse ServerName extension" \ |
| 2737 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2738 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2739 | |
| 2740 | run_test "SNI: DTLS, no matching cert" \ |
| 2741 | "$P_SRV debug_level=3 dtls=1 \ |
| 2742 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2743 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2744 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2745 | 1 \ |
| 2746 | -s "parse ServerName extension" \ |
| 2747 | -s "ssl_sni_wrapper() returned" \ |
| 2748 | -s "mbedtls_ssl_handshake returned" \ |
| 2749 | -c "mbedtls_ssl_handshake returned" \ |
| 2750 | -c "SSL - A fatal alert message was received from our peer" |
| 2751 | |
| 2752 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2753 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2754 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2755 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2756 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2757 | 0 \ |
| 2758 | -S "skip write certificate request" \ |
| 2759 | -C "skip parse certificate request" \ |
| 2760 | -c "got a certificate request" \ |
| 2761 | -C "skip write certificate" \ |
| 2762 | -C "skip write certificate verify" \ |
| 2763 | -S "skip parse certificate verify" |
| 2764 | |
| 2765 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2766 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2767 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2768 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2769 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2770 | 0 \ |
| 2771 | -S "skip write certificate request" \ |
| 2772 | -C "skip parse certificate request" \ |
| 2773 | -c "got a certificate request" \ |
| 2774 | -C "skip write certificate" \ |
| 2775 | -C "skip write certificate verify" \ |
| 2776 | -S "skip parse certificate verify" |
| 2777 | |
| 2778 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2779 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2780 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2781 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2782 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2783 | 0 \ |
| 2784 | -s "skip write certificate request" \ |
| 2785 | -C "skip parse certificate request" \ |
| 2786 | -c "got no certificate request" \ |
| 2787 | -c "skip write certificate" \ |
| 2788 | -c "skip write certificate verify" \ |
| 2789 | -s "skip parse certificate verify" |
| 2790 | |
| 2791 | run_test "SNI: DTLS, CA no override" \ |
| 2792 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2793 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2794 | ca_file=data_files/test-ca.crt \ |
| 2795 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2796 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2797 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2798 | 1 \ |
| 2799 | -S "skip write certificate request" \ |
| 2800 | -C "skip parse certificate request" \ |
| 2801 | -c "got a certificate request" \ |
| 2802 | -C "skip write certificate" \ |
| 2803 | -C "skip write certificate verify" \ |
| 2804 | -S "skip parse certificate verify" \ |
| 2805 | -s "x509_verify_cert() returned" \ |
| 2806 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2807 | -S "The certificate has been revoked (is on a CRL)" |
| 2808 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2809 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2810 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2811 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2812 | ca_file=data_files/test-ca.crt \ |
| 2813 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2814 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2815 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2816 | 0 \ |
| 2817 | -S "skip write certificate request" \ |
| 2818 | -C "skip parse certificate request" \ |
| 2819 | -c "got a certificate request" \ |
| 2820 | -C "skip write certificate" \ |
| 2821 | -C "skip write certificate verify" \ |
| 2822 | -S "skip parse certificate verify" \ |
| 2823 | -S "x509_verify_cert() returned" \ |
| 2824 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2825 | -S "The certificate has been revoked (is on a CRL)" |
| 2826 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2827 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2828 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2829 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2830 | ca_file=data_files/test-ca.crt \ |
| 2831 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2832 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2833 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2834 | 1 \ |
| 2835 | -S "skip write certificate request" \ |
| 2836 | -C "skip parse certificate request" \ |
| 2837 | -c "got a certificate request" \ |
| 2838 | -C "skip write certificate" \ |
| 2839 | -C "skip write certificate verify" \ |
| 2840 | -S "skip parse certificate verify" \ |
| 2841 | -s "x509_verify_cert() returned" \ |
| 2842 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2843 | -s "The certificate has been revoked (is on a CRL)" |
| 2844 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2845 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2847 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2848 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2849 | "$P_CLI nbio=2 tickets=0" \ |
| 2850 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2851 | -S "mbedtls_ssl_handshake returned" \ |
| 2852 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2853 | -c "Read from server: .* bytes read" |
| 2854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2855 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2856 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2857 | "$P_CLI nbio=2 tickets=0" \ |
| 2858 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2859 | -S "mbedtls_ssl_handshake returned" \ |
| 2860 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2861 | -c "Read from server: .* bytes read" |
| 2862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2863 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2864 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2865 | "$P_CLI nbio=2 tickets=1" \ |
| 2866 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2867 | -S "mbedtls_ssl_handshake returned" \ |
| 2868 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2869 | -c "Read from server: .* bytes read" |
| 2870 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2871 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2872 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2873 | "$P_CLI nbio=2 tickets=1" \ |
| 2874 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2875 | -S "mbedtls_ssl_handshake returned" \ |
| 2876 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2877 | -c "Read from server: .* bytes read" |
| 2878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2880 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2881 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2882 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2883 | -S "mbedtls_ssl_handshake returned" \ |
| 2884 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2885 | -c "Read from server: .* bytes read" |
| 2886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2887 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2888 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2889 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2890 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2891 | -S "mbedtls_ssl_handshake returned" \ |
| 2892 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2893 | -c "Read from server: .* bytes read" |
| 2894 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2895 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2896 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2897 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 2898 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2899 | -S "mbedtls_ssl_handshake returned" \ |
| 2900 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2901 | -c "Read from server: .* bytes read" |
| 2902 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 2903 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 2904 | |
| 2905 | run_test "Event-driven I/O: basic handshake" \ |
| 2906 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2907 | "$P_CLI event=1 tickets=0" \ |
| 2908 | 0 \ |
| 2909 | -S "mbedtls_ssl_handshake returned" \ |
| 2910 | -C "mbedtls_ssl_handshake returned" \ |
| 2911 | -c "Read from server: .* bytes read" |
| 2912 | |
| 2913 | run_test "Event-driven I/O: client auth" \ |
| 2914 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 2915 | "$P_CLI event=1 tickets=0" \ |
| 2916 | 0 \ |
| 2917 | -S "mbedtls_ssl_handshake returned" \ |
| 2918 | -C "mbedtls_ssl_handshake returned" \ |
| 2919 | -c "Read from server: .* bytes read" |
| 2920 | |
| 2921 | run_test "Event-driven I/O: ticket" \ |
| 2922 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2923 | "$P_CLI event=1 tickets=1" \ |
| 2924 | 0 \ |
| 2925 | -S "mbedtls_ssl_handshake returned" \ |
| 2926 | -C "mbedtls_ssl_handshake returned" \ |
| 2927 | -c "Read from server: .* bytes read" |
| 2928 | |
| 2929 | run_test "Event-driven I/O: ticket + client auth" \ |
| 2930 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2931 | "$P_CLI event=1 tickets=1" \ |
| 2932 | 0 \ |
| 2933 | -S "mbedtls_ssl_handshake returned" \ |
| 2934 | -C "mbedtls_ssl_handshake returned" \ |
| 2935 | -c "Read from server: .* bytes read" |
| 2936 | |
| 2937 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 2938 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2939 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2940 | 0 \ |
| 2941 | -S "mbedtls_ssl_handshake returned" \ |
| 2942 | -C "mbedtls_ssl_handshake returned" \ |
| 2943 | -c "Read from server: .* bytes read" |
| 2944 | |
| 2945 | run_test "Event-driven I/O: ticket + resume" \ |
| 2946 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2947 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2948 | 0 \ |
| 2949 | -S "mbedtls_ssl_handshake returned" \ |
| 2950 | -C "mbedtls_ssl_handshake returned" \ |
| 2951 | -c "Read from server: .* bytes read" |
| 2952 | |
| 2953 | run_test "Event-driven I/O: session-id resume" \ |
| 2954 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2955 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 2956 | 0 \ |
| 2957 | -S "mbedtls_ssl_handshake returned" \ |
| 2958 | -C "mbedtls_ssl_handshake returned" \ |
| 2959 | -c "Read from server: .* bytes read" |
| 2960 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 2961 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 2962 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2963 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2964 | 0 \ |
| 2965 | -c "Read from server: .* bytes read" |
| 2966 | |
| 2967 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 2968 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 2969 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2970 | 0 \ |
| 2971 | -c "Read from server: .* bytes read" |
| 2972 | |
| 2973 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 2974 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2975 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2976 | 0 \ |
| 2977 | -c "Read from server: .* bytes read" |
| 2978 | |
| 2979 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 2980 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2981 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2982 | 0 \ |
| 2983 | -c "Read from server: .* bytes read" |
| 2984 | |
| 2985 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 2986 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2987 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2988 | 0 \ |
| 2989 | -c "Read from server: .* bytes read" |
| 2990 | |
| 2991 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 2992 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2993 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2994 | 0 \ |
| 2995 | -c "Read from server: .* bytes read" |
| 2996 | |
| 2997 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 2998 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2999 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3000 | 0 \ |
| 3001 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3002 | |
| 3003 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3004 | # During session resumption, the client will send its ApplicationData record |
| 3005 | # within the same datagram as the Finished messages. In this situation, the |
| 3006 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3007 | # because the ApplicationData request has already been queued internally. |
| 3008 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3009 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3010 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3011 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3012 | 0 \ |
| 3013 | -c "Read from server: .* bytes read" |
| 3014 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3015 | # Tests for version negotiation |
| 3016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3017 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3018 | "$P_SRV" \ |
| 3019 | "$P_CLI" \ |
| 3020 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3021 | -S "mbedtls_ssl_handshake returned" \ |
| 3022 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3023 | -s "Protocol is TLSv1.2" \ |
| 3024 | -c "Protocol is TLSv1.2" |
| 3025 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3026 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3027 | "$P_SRV" \ |
| 3028 | "$P_CLI max_version=tls1_1" \ |
| 3029 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3030 | -S "mbedtls_ssl_handshake returned" \ |
| 3031 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3032 | -s "Protocol is TLSv1.1" \ |
| 3033 | -c "Protocol is TLSv1.1" |
| 3034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3035 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3036 | "$P_SRV max_version=tls1_1" \ |
| 3037 | "$P_CLI" \ |
| 3038 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3039 | -S "mbedtls_ssl_handshake returned" \ |
| 3040 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3041 | -s "Protocol is TLSv1.1" \ |
| 3042 | -c "Protocol is TLSv1.1" |
| 3043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3044 | 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] | 3045 | "$P_SRV max_version=tls1_1" \ |
| 3046 | "$P_CLI max_version=tls1_1" \ |
| 3047 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3048 | -S "mbedtls_ssl_handshake returned" \ |
| 3049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3050 | -s "Protocol is TLSv1.1" \ |
| 3051 | -c "Protocol is TLSv1.1" |
| 3052 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3053 | 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] | 3054 | "$P_SRV min_version=tls1_1" \ |
| 3055 | "$P_CLI max_version=tls1_1" \ |
| 3056 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3057 | -S "mbedtls_ssl_handshake returned" \ |
| 3058 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3059 | -s "Protocol is TLSv1.1" \ |
| 3060 | -c "Protocol is TLSv1.1" |
| 3061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3062 | 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] | 3063 | "$P_SRV max_version=tls1_1" \ |
| 3064 | "$P_CLI min_version=tls1_1" \ |
| 3065 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3066 | -S "mbedtls_ssl_handshake returned" \ |
| 3067 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3068 | -s "Protocol is TLSv1.1" \ |
| 3069 | -c "Protocol is TLSv1.1" |
| 3070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3071 | 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] | 3072 | "$P_SRV max_version=tls1_1" \ |
| 3073 | "$P_CLI min_version=tls1_2" \ |
| 3074 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3075 | -s "mbedtls_ssl_handshake returned" \ |
| 3076 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3077 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3079 | 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] | 3080 | "$P_SRV min_version=tls1_2" \ |
| 3081 | "$P_CLI max_version=tls1_1" \ |
| 3082 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3083 | -s "mbedtls_ssl_handshake returned" \ |
| 3084 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3085 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3086 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3087 | # Tests for ALPN extension |
| 3088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3089 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3090 | "$P_SRV debug_level=3" \ |
| 3091 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3092 | 0 \ |
| 3093 | -C "client hello, adding alpn extension" \ |
| 3094 | -S "found alpn extension" \ |
| 3095 | -C "got an alert message, type: \\[2:120]" \ |
| 3096 | -S "server hello, adding alpn extension" \ |
| 3097 | -C "found alpn extension " \ |
| 3098 | -C "Application Layer Protocol is" \ |
| 3099 | -S "Application Layer Protocol is" |
| 3100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3101 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3102 | "$P_SRV debug_level=3" \ |
| 3103 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3104 | 0 \ |
| 3105 | -c "client hello, adding alpn extension" \ |
| 3106 | -s "found alpn extension" \ |
| 3107 | -C "got an alert message, type: \\[2:120]" \ |
| 3108 | -S "server hello, adding alpn extension" \ |
| 3109 | -C "found alpn extension " \ |
| 3110 | -c "Application Layer Protocol is (none)" \ |
| 3111 | -S "Application Layer Protocol is" |
| 3112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3113 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3114 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3115 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3116 | 0 \ |
| 3117 | -C "client hello, adding alpn extension" \ |
| 3118 | -S "found alpn extension" \ |
| 3119 | -C "got an alert message, type: \\[2:120]" \ |
| 3120 | -S "server hello, adding alpn extension" \ |
| 3121 | -C "found alpn extension " \ |
| 3122 | -C "Application Layer Protocol is" \ |
| 3123 | -s "Application Layer Protocol is (none)" |
| 3124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3127 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3128 | 0 \ |
| 3129 | -c "client hello, adding alpn extension" \ |
| 3130 | -s "found alpn extension" \ |
| 3131 | -C "got an alert message, type: \\[2:120]" \ |
| 3132 | -s "server hello, adding alpn extension" \ |
| 3133 | -c "found alpn extension" \ |
| 3134 | -c "Application Layer Protocol is abc" \ |
| 3135 | -s "Application Layer Protocol is abc" |
| 3136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3137 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3138 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3139 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3140 | 0 \ |
| 3141 | -c "client hello, adding alpn extension" \ |
| 3142 | -s "found alpn extension" \ |
| 3143 | -C "got an alert message, type: \\[2:120]" \ |
| 3144 | -s "server hello, adding alpn extension" \ |
| 3145 | -c "found alpn extension" \ |
| 3146 | -c "Application Layer Protocol is abc" \ |
| 3147 | -s "Application Layer Protocol is abc" |
| 3148 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3149 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3150 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3151 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3152 | 0 \ |
| 3153 | -c "client hello, adding alpn extension" \ |
| 3154 | -s "found alpn extension" \ |
| 3155 | -C "got an alert message, type: \\[2:120]" \ |
| 3156 | -s "server hello, adding alpn extension" \ |
| 3157 | -c "found alpn extension" \ |
| 3158 | -c "Application Layer Protocol is 1234" \ |
| 3159 | -s "Application Layer Protocol is 1234" |
| 3160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3161 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3162 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3163 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3164 | 1 \ |
| 3165 | -c "client hello, adding alpn extension" \ |
| 3166 | -s "found alpn extension" \ |
| 3167 | -c "got an alert message, type: \\[2:120]" \ |
| 3168 | -S "server hello, adding alpn extension" \ |
| 3169 | -C "found alpn extension" \ |
| 3170 | -C "Application Layer Protocol is 1234" \ |
| 3171 | -S "Application Layer Protocol is 1234" |
| 3172 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3173 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3174 | # Tests for keyUsage in leaf certificates, part 1: |
| 3175 | # server-side certificate/suite selection |
| 3176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3177 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3178 | "$P_SRV key_file=data_files/server2.key \ |
| 3179 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3180 | "$P_CLI" \ |
| 3181 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3182 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3183 | |
| 3184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3185 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3186 | "$P_SRV key_file=data_files/server2.key \ |
| 3187 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3188 | "$P_CLI" \ |
| 3189 | 0 \ |
| 3190 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3191 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3192 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3193 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3194 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3195 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3196 | 1 \ |
| 3197 | -C "Ciphersuite is " |
| 3198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3199 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3200 | "$P_SRV key_file=data_files/server5.key \ |
| 3201 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3202 | "$P_CLI" \ |
| 3203 | 0 \ |
| 3204 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3205 | |
| 3206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3207 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3208 | "$P_SRV key_file=data_files/server5.key \ |
| 3209 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3210 | "$P_CLI" \ |
| 3211 | 0 \ |
| 3212 | -c "Ciphersuite is TLS-ECDH-" |
| 3213 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3214 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3215 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3216 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3217 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3218 | 1 \ |
| 3219 | -C "Ciphersuite is " |
| 3220 | |
| 3221 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3222 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3223 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3224 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3225 | "$O_SRV -key data_files/server2.key \ |
| 3226 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3227 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3228 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3229 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3230 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3231 | -C "Processing of the Certificate handshake message failed" \ |
| 3232 | -c "Ciphersuite is TLS-" |
| 3233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3234 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3235 | "$O_SRV -key data_files/server2.key \ |
| 3236 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3237 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3238 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3239 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3240 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3241 | -C "Processing of the Certificate handshake message failed" \ |
| 3242 | -c "Ciphersuite is TLS-" |
| 3243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3244 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3245 | "$O_SRV -key data_files/server2.key \ |
| 3246 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3247 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3248 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3249 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3250 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3251 | -C "Processing of the Certificate handshake message failed" \ |
| 3252 | -c "Ciphersuite is TLS-" |
| 3253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3254 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3255 | "$O_SRV -key data_files/server2.key \ |
| 3256 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3257 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3258 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3259 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3260 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3261 | -c "Processing of the Certificate handshake message failed" \ |
| 3262 | -C "Ciphersuite is TLS-" |
| 3263 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3264 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3265 | "$O_SRV -key data_files/server2.key \ |
| 3266 | -cert data_files/server2.ku-ke.crt" \ |
| 3267 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3268 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3269 | 0 \ |
| 3270 | -c "bad certificate (usage extensions)" \ |
| 3271 | -C "Processing of the Certificate handshake message failed" \ |
| 3272 | -c "Ciphersuite is TLS-" \ |
| 3273 | -c "! Usage does not match the keyUsage extension" |
| 3274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3275 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3276 | "$O_SRV -key data_files/server2.key \ |
| 3277 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3278 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3279 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3280 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3281 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3282 | -C "Processing of the Certificate handshake message failed" \ |
| 3283 | -c "Ciphersuite is TLS-" |
| 3284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3285 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3286 | "$O_SRV -key data_files/server2.key \ |
| 3287 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3288 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3289 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3290 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3291 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3292 | -c "Processing of the Certificate handshake message failed" \ |
| 3293 | -C "Ciphersuite is TLS-" |
| 3294 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3295 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3296 | "$O_SRV -key data_files/server2.key \ |
| 3297 | -cert data_files/server2.ku-ds.crt" \ |
| 3298 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3299 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3300 | 0 \ |
| 3301 | -c "bad certificate (usage extensions)" \ |
| 3302 | -C "Processing of the Certificate handshake message failed" \ |
| 3303 | -c "Ciphersuite is TLS-" \ |
| 3304 | -c "! Usage does not match the keyUsage extension" |
| 3305 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3306 | # Tests for keyUsage in leaf certificates, part 3: |
| 3307 | # server-side checking of client cert |
| 3308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3309 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3310 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3311 | "$O_CLI -key data_files/server2.key \ |
| 3312 | -cert data_files/server2.ku-ds.crt" \ |
| 3313 | 0 \ |
| 3314 | -S "bad certificate (usage extensions)" \ |
| 3315 | -S "Processing of the Certificate handshake message failed" |
| 3316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3317 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3318 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3319 | "$O_CLI -key data_files/server2.key \ |
| 3320 | -cert data_files/server2.ku-ke.crt" \ |
| 3321 | 0 \ |
| 3322 | -s "bad certificate (usage extensions)" \ |
| 3323 | -S "Processing of the Certificate handshake message failed" |
| 3324 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3325 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3326 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3327 | "$O_CLI -key data_files/server2.key \ |
| 3328 | -cert data_files/server2.ku-ke.crt" \ |
| 3329 | 1 \ |
| 3330 | -s "bad certificate (usage extensions)" \ |
| 3331 | -s "Processing of the Certificate handshake message failed" |
| 3332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3333 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3334 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3335 | "$O_CLI -key data_files/server5.key \ |
| 3336 | -cert data_files/server5.ku-ds.crt" \ |
| 3337 | 0 \ |
| 3338 | -S "bad certificate (usage extensions)" \ |
| 3339 | -S "Processing of the Certificate handshake message failed" |
| 3340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3341 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3342 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3343 | "$O_CLI -key data_files/server5.key \ |
| 3344 | -cert data_files/server5.ku-ka.crt" \ |
| 3345 | 0 \ |
| 3346 | -s "bad certificate (usage extensions)" \ |
| 3347 | -S "Processing of the Certificate handshake message failed" |
| 3348 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3349 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3351 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3352 | "$P_SRV key_file=data_files/server5.key \ |
| 3353 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3354 | "$P_CLI" \ |
| 3355 | 0 |
| 3356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3358 | "$P_SRV key_file=data_files/server5.key \ |
| 3359 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3360 | "$P_CLI" \ |
| 3361 | 0 |
| 3362 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3363 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3364 | "$P_SRV key_file=data_files/server5.key \ |
| 3365 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3366 | "$P_CLI" \ |
| 3367 | 0 |
| 3368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3369 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3370 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3371 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3372 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3373 | 1 |
| 3374 | |
| 3375 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3376 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3377 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3378 | "$O_SRV -key data_files/server5.key \ |
| 3379 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3380 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3381 | 0 \ |
| 3382 | -C "bad certificate (usage extensions)" \ |
| 3383 | -C "Processing of the Certificate handshake message failed" \ |
| 3384 | -c "Ciphersuite is TLS-" |
| 3385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3386 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3387 | "$O_SRV -key data_files/server5.key \ |
| 3388 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3389 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3390 | 0 \ |
| 3391 | -C "bad certificate (usage extensions)" \ |
| 3392 | -C "Processing of the Certificate handshake message failed" \ |
| 3393 | -c "Ciphersuite is TLS-" |
| 3394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3395 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3396 | "$O_SRV -key data_files/server5.key \ |
| 3397 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3398 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3399 | 0 \ |
| 3400 | -C "bad certificate (usage extensions)" \ |
| 3401 | -C "Processing of the Certificate handshake message failed" \ |
| 3402 | -c "Ciphersuite is TLS-" |
| 3403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3404 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3405 | "$O_SRV -key data_files/server5.key \ |
| 3406 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3407 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3408 | 1 \ |
| 3409 | -c "bad certificate (usage extensions)" \ |
| 3410 | -c "Processing of the Certificate handshake message failed" \ |
| 3411 | -C "Ciphersuite is TLS-" |
| 3412 | |
| 3413 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3414 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3415 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3416 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3417 | "$O_CLI -key data_files/server5.key \ |
| 3418 | -cert data_files/server5.eku-cli.crt" \ |
| 3419 | 0 \ |
| 3420 | -S "bad certificate (usage extensions)" \ |
| 3421 | -S "Processing of the Certificate handshake message failed" |
| 3422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3423 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3424 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3425 | "$O_CLI -key data_files/server5.key \ |
| 3426 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3427 | 0 \ |
| 3428 | -S "bad certificate (usage extensions)" \ |
| 3429 | -S "Processing of the Certificate handshake message failed" |
| 3430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3431 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3432 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3433 | "$O_CLI -key data_files/server5.key \ |
| 3434 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3435 | 0 \ |
| 3436 | -S "bad certificate (usage extensions)" \ |
| 3437 | -S "Processing of the Certificate handshake message failed" |
| 3438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3439 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3440 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3441 | "$O_CLI -key data_files/server5.key \ |
| 3442 | -cert data_files/server5.eku-cs.crt" \ |
| 3443 | 0 \ |
| 3444 | -s "bad certificate (usage extensions)" \ |
| 3445 | -S "Processing of the Certificate handshake message failed" |
| 3446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3447 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3448 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3449 | "$O_CLI -key data_files/server5.key \ |
| 3450 | -cert data_files/server5.eku-cs.crt" \ |
| 3451 | 1 \ |
| 3452 | -s "bad certificate (usage extensions)" \ |
| 3453 | -s "Processing of the Certificate handshake message failed" |
| 3454 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3455 | # Tests for DHM parameters loading |
| 3456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3457 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3458 | "$P_SRV" \ |
| 3459 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3460 | debug_level=3" \ |
| 3461 | 0 \ |
| 3462 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3463 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3465 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3466 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3467 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3468 | debug_level=3" \ |
| 3469 | 0 \ |
| 3470 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3471 | -c "value of 'DHM: G ' (2 bits)" |
| 3472 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3473 | # Tests for DHM client-side size checking |
| 3474 | |
| 3475 | run_test "DHM size: server default, client default, OK" \ |
| 3476 | "$P_SRV" \ |
| 3477 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3478 | debug_level=1" \ |
| 3479 | 0 \ |
| 3480 | -C "DHM prime too short:" |
| 3481 | |
| 3482 | run_test "DHM size: server default, client 2048, OK" \ |
| 3483 | "$P_SRV" \ |
| 3484 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3485 | debug_level=1 dhmlen=2048" \ |
| 3486 | 0 \ |
| 3487 | -C "DHM prime too short:" |
| 3488 | |
| 3489 | run_test "DHM size: server 1024, client default, OK" \ |
| 3490 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3491 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3492 | debug_level=1" \ |
| 3493 | 0 \ |
| 3494 | -C "DHM prime too short:" |
| 3495 | |
| 3496 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3497 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3498 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3499 | debug_level=1" \ |
| 3500 | 1 \ |
| 3501 | -c "DHM prime too short:" |
| 3502 | |
| 3503 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3504 | "$P_SRV" \ |
| 3505 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3506 | debug_level=1 dhmlen=2049" \ |
| 3507 | 1 \ |
| 3508 | -c "DHM prime too short:" |
| 3509 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3510 | # Tests for PSK callback |
| 3511 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3512 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3513 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3514 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3515 | psk_identity=foo psk=abc123" \ |
| 3516 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3517 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3518 | -S "SSL - Unknown identity received" \ |
| 3519 | -S "SSL - Verification of the message MAC failed" |
| 3520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3521 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3522 | "$P_SRV" \ |
| 3523 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3524 | psk_identity=foo psk=abc123" \ |
| 3525 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3526 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3527 | -S "SSL - Unknown identity received" \ |
| 3528 | -S "SSL - Verification of the message MAC failed" |
| 3529 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3530 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3531 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3532 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3533 | psk_identity=foo psk=abc123" \ |
| 3534 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3535 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3536 | -s "SSL - Unknown identity received" \ |
| 3537 | -S "SSL - Verification of the message MAC failed" |
| 3538 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3539 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3540 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3541 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3542 | psk_identity=abc psk=dead" \ |
| 3543 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3544 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3545 | -S "SSL - Unknown identity received" \ |
| 3546 | -S "SSL - Verification of the message MAC failed" |
| 3547 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3548 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3549 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3550 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3551 | psk_identity=def psk=beef" \ |
| 3552 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3553 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3554 | -S "SSL - Unknown identity received" \ |
| 3555 | -S "SSL - Verification of the message MAC failed" |
| 3556 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3557 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3558 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3559 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3560 | psk_identity=ghi psk=beef" \ |
| 3561 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3562 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3563 | -s "SSL - Unknown identity received" \ |
| 3564 | -S "SSL - Verification of the message MAC failed" |
| 3565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3566 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3567 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3568 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3569 | psk_identity=abc psk=beef" \ |
| 3570 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3571 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3572 | -S "SSL - Unknown identity received" \ |
| 3573 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3574 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3575 | # Tests for EC J-PAKE |
| 3576 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3578 | run_test "ECJPAKE: client not configured" \ |
| 3579 | "$P_SRV debug_level=3" \ |
| 3580 | "$P_CLI debug_level=3" \ |
| 3581 | 0 \ |
| 3582 | -C "add ciphersuite: c0ff" \ |
| 3583 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3584 | -S "found ecjpake kkpp extension" \ |
| 3585 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3586 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3587 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3588 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3589 | -S "None of the common ciphersuites is usable" |
| 3590 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3591 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3592 | run_test "ECJPAKE: server not configured" \ |
| 3593 | "$P_SRV debug_level=3" \ |
| 3594 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3595 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3596 | 1 \ |
| 3597 | -c "add ciphersuite: c0ff" \ |
| 3598 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3599 | -s "found ecjpake kkpp extension" \ |
| 3600 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3601 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3602 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3603 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3604 | -s "None of the common ciphersuites is usable" |
| 3605 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3606 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3607 | run_test "ECJPAKE: working, TLS" \ |
| 3608 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3609 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3610 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3611 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3612 | -c "add ciphersuite: c0ff" \ |
| 3613 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3614 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3615 | -s "found ecjpake kkpp extension" \ |
| 3616 | -S "skip ecjpake kkpp extension" \ |
| 3617 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3618 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3619 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3620 | -S "None of the common ciphersuites is usable" \ |
| 3621 | -S "SSL - Verification of the message MAC failed" |
| 3622 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3623 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3625 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 3626 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3627 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3628 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3629 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3630 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3631 | -s "SSL - Verification of the message MAC failed" |
| 3632 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3633 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3634 | run_test "ECJPAKE: working, DTLS" \ |
| 3635 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3636 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3637 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3638 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3639 | -c "re-using cached ecjpake parameters" \ |
| 3640 | -S "SSL - Verification of the message MAC failed" |
| 3641 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3643 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3644 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3645 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3646 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3647 | 0 \ |
| 3648 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3649 | -S "SSL - Verification of the message MAC failed" |
| 3650 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3651 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3652 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3653 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 3654 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3655 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 3656 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3657 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3658 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3659 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3660 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3661 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3663 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 3664 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 3665 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 3666 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3667 | 0 |
| 3668 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3669 | # Tests for ciphersuites per version |
| 3670 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3671 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3672 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3673 | "$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] | 3674 | "$P_CLI force_version=ssl3" \ |
| 3675 | 0 \ |
| 3676 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3678 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3679 | "$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] | 3680 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3681 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3682 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3684 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3685 | "$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] | 3686 | "$P_CLI force_version=tls1_1" \ |
| 3687 | 0 \ |
| 3688 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3690 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3691 | "$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] | 3692 | "$P_CLI force_version=tls1_2" \ |
| 3693 | 0 \ |
| 3694 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3695 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3696 | # Test for ClientHello without extensions |
| 3697 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3698 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3699 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3700 | "$P_SRV debug_level=3" \ |
| 3701 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3702 | 0 \ |
| 3703 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3704 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3705 | requires_gnutls |
| 3706 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3707 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
| 3708 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3709 | 0 \ |
| 3710 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3711 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3712 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3713 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3714 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3715 | "$P_SRV" \ |
| 3716 | "$P_CLI request_size=100" \ |
| 3717 | 0 \ |
| 3718 | -s "Read from client: 100 bytes read$" |
| 3719 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3720 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3721 | "$P_SRV" \ |
| 3722 | "$P_CLI request_size=500" \ |
| 3723 | 0 \ |
| 3724 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3725 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3726 | # Tests for small packets |
| 3727 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3729 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3730 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3731 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3732 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3733 | 0 \ |
| 3734 | -s "Read from client: 1 bytes read" |
| 3735 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3736 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3737 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3738 | "$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] | 3739 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3740 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3741 | 0 \ |
| 3742 | -s "Read from client: 1 bytes read" |
| 3743 | |
| 3744 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 3745 | "$P_SRV" \ |
| 3746 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3748 | 0 \ |
| 3749 | -s "Read from client: 1 bytes read" |
| 3750 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3751 | run_test "Small packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3752 | "$P_SRV" \ |
| 3753 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3754 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3755 | 0 \ |
| 3756 | -s "Read from client: 1 bytes read" |
| 3757 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3758 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3759 | run_test "Small packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3760 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3761 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3762 | 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] | 3763 | 0 \ |
| 3764 | -s "Read from client: 1 bytes read" |
| 3765 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3766 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3767 | run_test "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3768 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3769 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3770 | 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] | 3771 | 0 \ |
| 3772 | -s "Read from client: 1 bytes read" |
| 3773 | |
| 3774 | run_test "Small packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3775 | "$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] | 3776 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3777 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3778 | 0 \ |
| 3779 | -s "Read from client: 1 bytes read" |
| 3780 | |
| 3781 | run_test "Small packet TLS 1.0 StreamCipher, without EtM" \ |
| 3782 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3783 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3784 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3785 | 0 \ |
| 3786 | -s "Read from client: 1 bytes read" |
| 3787 | |
| 3788 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3789 | run_test "Small packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3790 | "$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] | 3791 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3792 | 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] | 3793 | 0 \ |
| 3794 | -s "Read from client: 1 bytes read" |
| 3795 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3796 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3797 | run_test "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3798 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3799 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3800 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3801 | 0 \ |
| 3802 | -s "Read from client: 1 bytes read" |
| 3803 | |
| 3804 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 3805 | "$P_SRV" \ |
| 3806 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3807 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3808 | 0 \ |
| 3809 | -s "Read from client: 1 bytes read" |
| 3810 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3811 | run_test "Small packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3812 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3813 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3814 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3815 | 0 \ |
| 3816 | -s "Read from client: 1 bytes read" |
| 3817 | |
| 3818 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3819 | run_test "Small packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3820 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3821 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3822 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3823 | 0 \ |
| 3824 | -s "Read from client: 1 bytes read" |
| 3825 | |
| 3826 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3827 | run_test "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3828 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3829 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3830 | 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] | 3831 | 0 \ |
| 3832 | -s "Read from client: 1 bytes read" |
| 3833 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3834 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3835 | "$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] | 3836 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3837 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3838 | 0 \ |
| 3839 | -s "Read from client: 1 bytes read" |
| 3840 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3841 | run_test "Small packet TLS 1.1 StreamCipher, without EtM" \ |
| 3842 | "$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] | 3843 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3844 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3845 | 0 \ |
| 3846 | -s "Read from client: 1 bytes read" |
| 3847 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3848 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3849 | run_test "Small packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3850 | "$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] | 3851 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3852 | 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] | 3853 | 0 \ |
| 3854 | -s "Read from client: 1 bytes read" |
| 3855 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3856 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3857 | run_test "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3858 | "$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] | 3859 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3860 | 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] | 3861 | 0 \ |
| 3862 | -s "Read from client: 1 bytes read" |
| 3863 | |
| 3864 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 3865 | "$P_SRV" \ |
| 3866 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3867 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3868 | 0 \ |
| 3869 | -s "Read from client: 1 bytes read" |
| 3870 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3871 | run_test "Small packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3872 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3873 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3874 | 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] | 3875 | 0 \ |
| 3876 | -s "Read from client: 1 bytes read" |
| 3877 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3878 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 3879 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3880 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3881 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3882 | 0 \ |
| 3883 | -s "Read from client: 1 bytes read" |
| 3884 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3885 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3886 | run_test "Small packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3887 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3888 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3889 | 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] | 3890 | 0 \ |
| 3891 | -s "Read from client: 1 bytes read" |
| 3892 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3893 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3894 | run_test "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3895 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3896 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3897 | 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] | 3898 | 0 \ |
| 3899 | -s "Read from client: 1 bytes read" |
| 3900 | |
| 3901 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3902 | "$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] | 3903 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3904 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3905 | 0 \ |
| 3906 | -s "Read from client: 1 bytes read" |
| 3907 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3908 | run_test "Small packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3909 | "$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] | 3910 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3911 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3912 | 0 \ |
| 3913 | -s "Read from client: 1 bytes read" |
| 3914 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3915 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3916 | run_test "Small packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3917 | "$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] | 3918 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3919 | 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] | 3920 | 0 \ |
| 3921 | -s "Read from client: 1 bytes read" |
| 3922 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3923 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3924 | run_test "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3925 | "$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] | 3926 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3927 | 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] | 3928 | 0 \ |
| 3929 | -s "Read from client: 1 bytes read" |
| 3930 | |
| 3931 | run_test "Small packet TLS 1.2 AEAD" \ |
| 3932 | "$P_SRV" \ |
| 3933 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3935 | 0 \ |
| 3936 | -s "Read from client: 1 bytes read" |
| 3937 | |
| 3938 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 3939 | "$P_SRV" \ |
| 3940 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3941 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3942 | 0 \ |
| 3943 | -s "Read from client: 1 bytes read" |
| 3944 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3945 | # Tests for small packets in DTLS |
| 3946 | |
| 3947 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3948 | run_test "Small packet DTLS 1.0" \ |
| 3949 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 3950 | "$P_CLI dtls=1 request_size=1 \ |
| 3951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3952 | 0 \ |
| 3953 | -s "Read from client: 1 bytes read" |
| 3954 | |
| 3955 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3956 | run_test "Small packet DTLS 1.0, without EtM" \ |
| 3957 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 3958 | "$P_CLI dtls=1 request_size=1 \ |
| 3959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3960 | 0 \ |
| 3961 | -s "Read from client: 1 bytes read" |
| 3962 | |
| 3963 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3964 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3965 | run_test "Small packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3966 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 3967 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3969 | 0 \ |
| 3970 | -s "Read from client: 1 bytes read" |
| 3971 | |
| 3972 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3973 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3974 | run_test "Small packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3975 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3976 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3977 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3978 | 0 \ |
| 3979 | -s "Read from client: 1 bytes read" |
| 3980 | |
| 3981 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3982 | run_test "Small packet DTLS 1.2" \ |
| 3983 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 3984 | "$P_CLI dtls=1 request_size=1 \ |
| 3985 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3986 | 0 \ |
| 3987 | -s "Read from client: 1 bytes read" |
| 3988 | |
| 3989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3990 | run_test "Small packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3991 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3992 | "$P_CLI dtls=1 request_size=1 \ |
| 3993 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3994 | 0 \ |
| 3995 | -s "Read from client: 1 bytes read" |
| 3996 | |
| 3997 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3998 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3999 | run_test "Small packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4000 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4001 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4002 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4003 | 0 \ |
| 4004 | -s "Read from client: 1 bytes read" |
| 4005 | |
| 4006 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4007 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4008 | run_test "Small packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4009 | "$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] | 4010 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4011 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4012 | 0 \ |
| 4013 | -s "Read from client: 1 bytes read" |
| 4014 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4015 | # A test for extensions in SSLv3 |
| 4016 | |
| 4017 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4018 | run_test "SSLv3 with extensions, server side" \ |
| 4019 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4020 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4021 | 0 \ |
| 4022 | -S "dumping 'client hello extensions'" \ |
| 4023 | -S "server hello, total extension length:" |
| 4024 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4025 | # Test for large packets |
| 4026 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4027 | # How many fragments do we expect to write $1 bytes? |
| 4028 | fragments_for_write() { |
| 4029 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4030 | } |
| 4031 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4033 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4034 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4035 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4036 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4037 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4038 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4039 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4040 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4041 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4042 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4043 | "$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] | 4044 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4045 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4046 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4047 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4049 | |
| 4050 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 4051 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4052 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4053 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4054 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4055 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4056 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4057 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4058 | run_test "Large packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4059 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4060 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4061 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4062 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4063 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4064 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4065 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4066 | run_test "Large packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4067 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4068 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4069 | 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] | 4070 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4071 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4072 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4073 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4074 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4075 | run_test "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4076 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4077 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4078 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4079 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4080 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4081 | |
| 4082 | run_test "Large packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4083 | "$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] | 4084 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4085 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4086 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4087 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4088 | |
| 4089 | run_test "Large packet TLS 1.0 StreamCipher, without EtM" \ |
| 4090 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4091 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4092 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4093 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4094 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4095 | |
| 4096 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4097 | run_test "Large packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4098 | "$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] | 4099 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4100 | 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] | 4101 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4102 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4103 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4104 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4105 | run_test "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4106 | "$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] | 4107 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4108 | 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] | 4109 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4110 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4111 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4112 | |
| 4113 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 4114 | "$P_SRV" \ |
| 4115 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4116 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4117 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4118 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4119 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4120 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4121 | run_test "Large packet TLS 1.1 BlockCipher, without EtM" \ |
| 4122 | "$P_SRV" \ |
| 4123 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4124 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4125 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4126 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4127 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4128 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4129 | run_test "Large packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4130 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4131 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4132 | 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] | 4133 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4134 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4135 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4137 | run_test "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4138 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4139 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4140 | 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] | 4141 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4142 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4143 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4144 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 4145 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4146 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4147 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4148 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4149 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4150 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4151 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4152 | run_test "Large packet TLS 1.1 StreamCipher, without EtM" \ |
| 4153 | "$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] | 4154 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4155 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4156 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4157 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4158 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4159 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4160 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4161 | run_test "Large packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4162 | "$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] | 4163 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4164 | 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] | 4165 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4166 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4167 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4168 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4169 | run_test "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4170 | "$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] | 4171 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4172 | 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] | 4173 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4174 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4175 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4176 | |
| 4177 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 4178 | "$P_SRV" \ |
| 4179 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4180 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4181 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4182 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4183 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4184 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4185 | run_test "Large packet TLS 1.2 BlockCipher, without EtM" \ |
| 4186 | "$P_SRV" \ |
| 4187 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4188 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4189 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4190 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4191 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4192 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 4193 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4194 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4195 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4196 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4197 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4198 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4199 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4200 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4201 | run_test "Large packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4202 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4203 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4204 | 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] | 4205 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4206 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4207 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4209 | run_test "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4210 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4211 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4212 | 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] | 4213 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4214 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4215 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4216 | |
| 4217 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4218 | "$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] | 4219 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4220 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4221 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4222 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4223 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4224 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4225 | run_test "Large packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4226 | "$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] | 4227 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4229 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4230 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4231 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4232 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4233 | run_test "Large packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4234 | "$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] | 4235 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4236 | 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] | 4237 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4238 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4239 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4241 | run_test "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4242 | "$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] | 4243 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4244 | 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] | 4245 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4246 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4247 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4248 | |
| 4249 | run_test "Large packet TLS 1.2 AEAD" \ |
| 4250 | "$P_SRV" \ |
| 4251 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4252 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4253 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4254 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4255 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4256 | |
| 4257 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 4258 | "$P_SRV" \ |
| 4259 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4260 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4261 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4262 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4263 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4264 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4265 | # Tests of asynchronous private key support in SSL |
| 4266 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4267 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4268 | run_test "SSL async private: sign, delay=0" \ |
| 4269 | "$P_SRV \ |
| 4270 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4271 | "$P_CLI" \ |
| 4272 | 0 \ |
| 4273 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4274 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4275 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4277 | run_test "SSL async private: sign, delay=1" \ |
| 4278 | "$P_SRV \ |
| 4279 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4280 | "$P_CLI" \ |
| 4281 | 0 \ |
| 4282 | -s "Async sign callback: using key slot " \ |
| 4283 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4284 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4285 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4286 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4287 | run_test "SSL async private: sign, delay=2" \ |
| 4288 | "$P_SRV \ |
| 4289 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 4290 | "$P_CLI" \ |
| 4291 | 0 \ |
| 4292 | -s "Async sign callback: using key slot " \ |
| 4293 | -U "Async sign callback: using key slot " \ |
| 4294 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 4295 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4296 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4297 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4298 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 4299 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 4300 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4302 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 4303 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 4304 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 4305 | "$P_CLI force_version=tls1_1" \ |
| 4306 | 0 \ |
| 4307 | -s "Async sign callback: using key slot " \ |
| 4308 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4309 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4311 | run_test "SSL async private: sign, SNI" \ |
| 4312 | "$P_SRV debug_level=3 \ |
| 4313 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 4314 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4315 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4316 | "$P_CLI server_name=polarssl.example" \ |
| 4317 | 0 \ |
| 4318 | -s "Async sign callback: using key slot " \ |
| 4319 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4320 | -s "parse ServerName extension" \ |
| 4321 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4322 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4323 | |
| 4324 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4325 | run_test "SSL async private: decrypt, delay=0" \ |
| 4326 | "$P_SRV \ |
| 4327 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4328 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4329 | 0 \ |
| 4330 | -s "Async decrypt callback: using key slot " \ |
| 4331 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4332 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4333 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4334 | run_test "SSL async private: decrypt, delay=1" \ |
| 4335 | "$P_SRV \ |
| 4336 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4337 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4338 | 0 \ |
| 4339 | -s "Async decrypt callback: using key slot " \ |
| 4340 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4341 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4342 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4343 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4344 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 4345 | "$P_SRV psk=abc123 \ |
| 4346 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4347 | "$P_CLI psk=abc123 \ |
| 4348 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4349 | 0 \ |
| 4350 | -s "Async decrypt callback: using key slot " \ |
| 4351 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4352 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4353 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4354 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 4355 | "$P_SRV psk=abc123 \ |
| 4356 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4357 | "$P_CLI psk=abc123 \ |
| 4358 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4359 | 0 \ |
| 4360 | -s "Async decrypt callback: using key slot " \ |
| 4361 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4362 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4363 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4364 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4365 | run_test "SSL async private: sign callback not present" \ |
| 4366 | "$P_SRV \ |
| 4367 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4368 | "$P_CLI; [ \$? -eq 1 ] && |
| 4369 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4370 | 0 \ |
| 4371 | -S "Async sign callback" \ |
| 4372 | -s "! mbedtls_ssl_handshake returned" \ |
| 4373 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 4374 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 4375 | -s "Successful connection" |
| 4376 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4378 | run_test "SSL async private: decrypt callback not present" \ |
| 4379 | "$P_SRV debug_level=1 \ |
| 4380 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 4381 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 4382 | [ \$? -eq 1 ] && $P_CLI" \ |
| 4383 | 0 \ |
| 4384 | -S "Async decrypt callback" \ |
| 4385 | -s "! mbedtls_ssl_handshake returned" \ |
| 4386 | -s "got no RSA private key" \ |
| 4387 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4388 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4389 | |
| 4390 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4391 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4392 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4393 | "$P_SRV \ |
| 4394 | async_operations=s async_private_delay1=1 \ |
| 4395 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4396 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4397 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4398 | 0 \ |
| 4399 | -s "Async sign callback: using key slot 0," \ |
| 4400 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4401 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4402 | |
| 4403 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4404 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4405 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4406 | "$P_SRV \ |
| 4407 | async_operations=s async_private_delay2=1 \ |
| 4408 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4409 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4410 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4411 | 0 \ |
| 4412 | -s "Async sign callback: using key slot 0," \ |
| 4413 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4414 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4415 | |
| 4416 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4418 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4419 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4420 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4421 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4422 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4423 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4424 | 0 \ |
| 4425 | -s "Async sign callback: using key slot 1," \ |
| 4426 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4427 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4428 | |
| 4429 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4430 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4431 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4432 | "$P_SRV \ |
| 4433 | async_operations=s async_private_delay1=1 \ |
| 4434 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4435 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4436 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4437 | 0 \ |
| 4438 | -s "Async sign callback: no key matches this certificate." |
| 4439 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4440 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4441 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4442 | "$P_SRV \ |
| 4443 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4444 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4445 | "$P_CLI" \ |
| 4446 | 1 \ |
| 4447 | -s "Async sign callback: injected error" \ |
| 4448 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4449 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4450 | -s "! mbedtls_ssl_handshake returned" |
| 4451 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4452 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4453 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4454 | "$P_SRV \ |
| 4455 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4456 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4457 | "$P_CLI" \ |
| 4458 | 1 \ |
| 4459 | -s "Async sign callback: using key slot " \ |
| 4460 | -S "Async resume" \ |
| 4461 | -s "Async cancel" |
| 4462 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4463 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4464 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4465 | "$P_SRV \ |
| 4466 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4467 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4468 | "$P_CLI" \ |
| 4469 | 1 \ |
| 4470 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4471 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4472 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4473 | -s "! mbedtls_ssl_handshake returned" |
| 4474 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4475 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4476 | run_test "SSL async private: decrypt, error in start" \ |
| 4477 | "$P_SRV \ |
| 4478 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4479 | async_private_error=1" \ |
| 4480 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4481 | 1 \ |
| 4482 | -s "Async decrypt callback: injected error" \ |
| 4483 | -S "Async resume" \ |
| 4484 | -S "Async cancel" \ |
| 4485 | -s "! mbedtls_ssl_handshake returned" |
| 4486 | |
| 4487 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4488 | run_test "SSL async private: decrypt, cancel after start" \ |
| 4489 | "$P_SRV \ |
| 4490 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4491 | async_private_error=2" \ |
| 4492 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4493 | 1 \ |
| 4494 | -s "Async decrypt callback: using key slot " \ |
| 4495 | -S "Async resume" \ |
| 4496 | -s "Async cancel" |
| 4497 | |
| 4498 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4499 | run_test "SSL async private: decrypt, error in resume" \ |
| 4500 | "$P_SRV \ |
| 4501 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4502 | async_private_error=3" \ |
| 4503 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4504 | 1 \ |
| 4505 | -s "Async decrypt callback: using key slot " \ |
| 4506 | -s "Async resume callback: decrypt done but injected error" \ |
| 4507 | -S "Async cancel" \ |
| 4508 | -s "! mbedtls_ssl_handshake returned" |
| 4509 | |
| 4510 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4511 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4512 | "$P_SRV \ |
| 4513 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4514 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4515 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4516 | 0 \ |
| 4517 | -s "Async cancel" \ |
| 4518 | -s "! mbedtls_ssl_handshake returned" \ |
| 4519 | -s "Async resume" \ |
| 4520 | -s "Successful connection" |
| 4521 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4522 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4523 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4524 | "$P_SRV \ |
| 4525 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4526 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4527 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4528 | 0 \ |
| 4529 | -s "! mbedtls_ssl_handshake returned" \ |
| 4530 | -s "Async resume" \ |
| 4531 | -s "Successful connection" |
| 4532 | |
| 4533 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4535 | 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] | 4536 | "$P_SRV \ |
| 4537 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 4538 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4539 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4540 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4541 | [ \$? -eq 1 ] && |
| 4542 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4543 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4544 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4545 | -S "Async resume" \ |
| 4546 | -s "Async cancel" \ |
| 4547 | -s "! mbedtls_ssl_handshake returned" \ |
| 4548 | -s "Async sign callback: no key matches this certificate." \ |
| 4549 | -s "Successful connection" |
| 4550 | |
| 4551 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4552 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4553 | 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] | 4554 | "$P_SRV \ |
| 4555 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 4556 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4557 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4558 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4559 | [ \$? -eq 1 ] && |
| 4560 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4561 | 0 \ |
| 4562 | -s "Async resume" \ |
| 4563 | -s "! mbedtls_ssl_handshake returned" \ |
| 4564 | -s "Async sign callback: no key matches this certificate." \ |
| 4565 | -s "Successful connection" |
| 4566 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4568 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4569 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 4570 | "$P_SRV \ |
| 4571 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4572 | exchanges=2 renegotiation=1" \ |
| 4573 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4574 | 0 \ |
| 4575 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4576 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4577 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4579 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4580 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 4581 | "$P_SRV \ |
| 4582 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4583 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4584 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 4585 | 0 \ |
| 4586 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4587 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4588 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4589 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4591 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 4592 | "$P_SRV \ |
| 4593 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4594 | exchanges=2 renegotiation=1" \ |
| 4595 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 4596 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4597 | 0 \ |
| 4598 | -s "Async decrypt callback: using key slot " \ |
| 4599 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4600 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4601 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4603 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 4604 | "$P_SRV \ |
| 4605 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4606 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4607 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 4608 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4609 | 0 \ |
| 4610 | -s "Async decrypt callback: using key slot " \ |
| 4611 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4612 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4613 | # Tests for DTLS HelloVerifyRequest |
| 4614 | |
| 4615 | run_test "DTLS cookie: enabled" \ |
| 4616 | "$P_SRV dtls=1 debug_level=2" \ |
| 4617 | "$P_CLI dtls=1 debug_level=2" \ |
| 4618 | 0 \ |
| 4619 | -s "cookie verification failed" \ |
| 4620 | -s "cookie verification passed" \ |
| 4621 | -S "cookie verification skipped" \ |
| 4622 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4623 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4624 | -S "SSL - The requested feature is not available" |
| 4625 | |
| 4626 | run_test "DTLS cookie: disabled" \ |
| 4627 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4628 | "$P_CLI dtls=1 debug_level=2" \ |
| 4629 | 0 \ |
| 4630 | -S "cookie verification failed" \ |
| 4631 | -S "cookie verification passed" \ |
| 4632 | -s "cookie verification skipped" \ |
| 4633 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4634 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4635 | -S "SSL - The requested feature is not available" |
| 4636 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4637 | run_test "DTLS cookie: default (failing)" \ |
| 4638 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4639 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4640 | 1 \ |
| 4641 | -s "cookie verification failed" \ |
| 4642 | -S "cookie verification passed" \ |
| 4643 | -S "cookie verification skipped" \ |
| 4644 | -C "received hello verify request" \ |
| 4645 | -S "hello verification requested" \ |
| 4646 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4647 | |
| 4648 | requires_ipv6 |
| 4649 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4650 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4651 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4652 | 0 \ |
| 4653 | -s "cookie verification failed" \ |
| 4654 | -s "cookie verification passed" \ |
| 4655 | -S "cookie verification skipped" \ |
| 4656 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4657 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4658 | -S "SSL - The requested feature is not available" |
| 4659 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4660 | run_test "DTLS cookie: enabled, nbio" \ |
| 4661 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 4662 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4663 | 0 \ |
| 4664 | -s "cookie verification failed" \ |
| 4665 | -s "cookie verification passed" \ |
| 4666 | -S "cookie verification skipped" \ |
| 4667 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4668 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4669 | -S "SSL - The requested feature is not available" |
| 4670 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4671 | # Tests for client reconnecting from the same port with DTLS |
| 4672 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4673 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4674 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4675 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4676 | "$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] | 4677 | 0 \ |
| 4678 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4679 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4680 | -S "Client initiated reconnection from same port" |
| 4681 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4682 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4683 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4684 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4685 | "$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] | 4686 | 0 \ |
| 4687 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4688 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4689 | -s "Client initiated reconnection from same port" |
| 4690 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4691 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4692 | 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] | 4693 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4694 | "$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] | 4695 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4696 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4697 | -s "Client initiated reconnection from same port" |
| 4698 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4699 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 4700 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 4701 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 4702 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4703 | 0 \ |
| 4704 | -S "The operation timed out" \ |
| 4705 | -s "Client initiated reconnection from same port" |
| 4706 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4707 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 4708 | "$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] | 4709 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4710 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4711 | -s "The operation timed out" \ |
| 4712 | -S "Client initiated reconnection from same port" |
| 4713 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4714 | # Tests for various cases of client authentication with DTLS |
| 4715 | # (focused on handshake flows and message parsing) |
| 4716 | |
| 4717 | run_test "DTLS client auth: required" \ |
| 4718 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4719 | "$P_CLI dtls=1" \ |
| 4720 | 0 \ |
| 4721 | -s "Verifying peer X.509 certificate... ok" |
| 4722 | |
| 4723 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4724 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4725 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4726 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4727 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4728 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4729 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4730 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4731 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4732 | 0 \ |
| 4733 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4734 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4735 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4736 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4737 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4738 | "$P_CLI dtls=1 psk=abc124" \ |
| 4739 | 1 \ |
| 4740 | -s "SSL - Verification of the message MAC failed" \ |
| 4741 | -c "SSL - A fatal alert message was received from our peer" |
| 4742 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4743 | # Tests for receiving fragmented handshake messages with DTLS |
| 4744 | |
| 4745 | requires_gnutls |
| 4746 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4747 | "$G_SRV -u --mtu 2048 -a" \ |
| 4748 | "$P_CLI dtls=1 debug_level=2" \ |
| 4749 | 0 \ |
| 4750 | -C "found fragmented DTLS handshake message" \ |
| 4751 | -C "error" |
| 4752 | |
| 4753 | requires_gnutls |
| 4754 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4755 | "$G_SRV -u --mtu 512" \ |
| 4756 | "$P_CLI dtls=1 debug_level=2" \ |
| 4757 | 0 \ |
| 4758 | -c "found fragmented DTLS handshake message" \ |
| 4759 | -C "error" |
| 4760 | |
| 4761 | requires_gnutls |
| 4762 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 4763 | "$G_SRV -u --mtu 128" \ |
| 4764 | "$P_CLI dtls=1 debug_level=2" \ |
| 4765 | 0 \ |
| 4766 | -c "found fragmented DTLS handshake message" \ |
| 4767 | -C "error" |
| 4768 | |
| 4769 | requires_gnutls |
| 4770 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 4771 | "$G_SRV -u --mtu 128" \ |
| 4772 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4773 | 0 \ |
| 4774 | -c "found fragmented DTLS handshake message" \ |
| 4775 | -C "error" |
| 4776 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4777 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4778 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4779 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4780 | "$G_SRV -u --mtu 256" \ |
| 4781 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4782 | 0 \ |
| 4783 | -c "found fragmented DTLS handshake message" \ |
| 4784 | -c "client hello, adding renegotiation extension" \ |
| 4785 | -c "found renegotiation extension" \ |
| 4786 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4787 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4788 | -C "error" \ |
| 4789 | -s "Extra-header:" |
| 4790 | |
| 4791 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4793 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4794 | "$G_SRV -u --mtu 256" \ |
| 4795 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4796 | 0 \ |
| 4797 | -c "found fragmented DTLS handshake message" \ |
| 4798 | -c "client hello, adding renegotiation extension" \ |
| 4799 | -c "found renegotiation extension" \ |
| 4800 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4801 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4802 | -C "error" \ |
| 4803 | -s "Extra-header:" |
| 4804 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4805 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4806 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4807 | "$P_CLI dtls=1 debug_level=2" \ |
| 4808 | 0 \ |
| 4809 | -C "found fragmented DTLS handshake message" \ |
| 4810 | -C "error" |
| 4811 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4812 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4813 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4814 | "$P_CLI dtls=1 debug_level=2" \ |
| 4815 | 0 \ |
| 4816 | -c "found fragmented DTLS handshake message" \ |
| 4817 | -C "error" |
| 4818 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4819 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4820 | "$O_SRV -dtls1 -mtu 256" \ |
| 4821 | "$P_CLI dtls=1 debug_level=2" \ |
| 4822 | 0 \ |
| 4823 | -c "found fragmented DTLS handshake message" \ |
| 4824 | -C "error" |
| 4825 | |
| 4826 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4827 | "$O_SRV -dtls1 -mtu 256" \ |
| 4828 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4829 | 0 \ |
| 4830 | -c "found fragmented DTLS handshake message" \ |
| 4831 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4832 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4833 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4834 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4835 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4836 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4837 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4838 | "$P_SRV dtls=1 debug_level=2" \ |
| 4839 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4840 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4841 | -C "replayed record" \ |
| 4842 | -S "replayed record" \ |
| 4843 | -C "record from another epoch" \ |
| 4844 | -S "record from another epoch" \ |
| 4845 | -C "discarding invalid record" \ |
| 4846 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4847 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4848 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4849 | -c "HTTP/1.0 200 OK" |
| 4850 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4851 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4852 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4853 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4854 | "$P_SRV dtls=1 debug_level=2" \ |
| 4855 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4856 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4857 | -c "replayed record" \ |
| 4858 | -s "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4859 | -c "record from another epoch" \ |
| 4860 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4861 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4862 | -s "Extra-header:" \ |
| 4863 | -c "HTTP/1.0 200 OK" |
| 4864 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4865 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 4866 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4867 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 4868 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4869 | 0 \ |
| 4870 | -c "replayed record" \ |
| 4871 | -S "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4872 | -c "record from another epoch" \ |
| 4873 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4874 | -c "resend" \ |
| 4875 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4876 | -s "Extra-header:" \ |
| 4877 | -c "HTTP/1.0 200 OK" |
| 4878 | |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4879 | run_test "DTLS proxy: multiple records in same datagram" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4880 | -p "$P_PXY pack=50" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4881 | "$P_SRV dtls=1 debug_level=2" \ |
| 4882 | "$P_CLI dtls=1 debug_level=2" \ |
| 4883 | 0 \ |
| 4884 | -c "next record in same datagram" \ |
| 4885 | -s "next record in same datagram" |
| 4886 | |
| 4887 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4888 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4889 | "$P_SRV dtls=1 debug_level=2" \ |
| 4890 | "$P_CLI dtls=1 debug_level=2" \ |
| 4891 | 0 \ |
| 4892 | -c "next record in same datagram" \ |
| 4893 | -s "next record in same datagram" |
| 4894 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4895 | 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] | 4896 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4897 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4898 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4899 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4900 | -c "discarding invalid record (mac)" \ |
| 4901 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4902 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4903 | -c "HTTP/1.0 200 OK" \ |
| 4904 | -S "too many records with bad MAC" \ |
| 4905 | -S "Verification of the message MAC failed" |
| 4906 | |
| 4907 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 4908 | -p "$P_PXY bad_ad=1" \ |
| 4909 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 4910 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4911 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4912 | -C "discarding invalid record (mac)" \ |
| 4913 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4914 | -S "Extra-header:" \ |
| 4915 | -C "HTTP/1.0 200 OK" \ |
| 4916 | -s "too many records with bad MAC" \ |
| 4917 | -s "Verification of the message MAC failed" |
| 4918 | |
| 4919 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 4920 | -p "$P_PXY bad_ad=1" \ |
| 4921 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 4922 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4923 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4924 | -c "discarding invalid record (mac)" \ |
| 4925 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4926 | -s "Extra-header:" \ |
| 4927 | -c "HTTP/1.0 200 OK" \ |
| 4928 | -S "too many records with bad MAC" \ |
| 4929 | -S "Verification of the message MAC failed" |
| 4930 | |
| 4931 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 4932 | -p "$P_PXY bad_ad=1" \ |
| 4933 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 4934 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 4935 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4936 | -c "discarding invalid record (mac)" \ |
| 4937 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4938 | -s "Extra-header:" \ |
| 4939 | -c "HTTP/1.0 200 OK" \ |
| 4940 | -s "too many records with bad MAC" \ |
| 4941 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4942 | |
| 4943 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4944 | -p "$P_PXY delay_ccs=1" \ |
| 4945 | "$P_SRV dtls=1 debug_level=1" \ |
| 4946 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4947 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4948 | -c "record from another epoch" \ |
| 4949 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4950 | -s "Extra-header:" \ |
| 4951 | -c "HTTP/1.0 200 OK" |
| 4952 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4953 | # 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] | 4954 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4955 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4956 | 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] | 4957 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4958 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4959 | psk=abc123" \ |
| 4960 | "$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] | 4961 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4962 | 0 \ |
| 4963 | -s "Extra-header:" \ |
| 4964 | -c "HTTP/1.0 200 OK" |
| 4965 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4966 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4967 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 4968 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4969 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4970 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4971 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4972 | 0 \ |
| 4973 | -s "Extra-header:" \ |
| 4974 | -c "HTTP/1.0 200 OK" |
| 4975 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4976 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4977 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 4978 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4979 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4980 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4981 | 0 \ |
| 4982 | -s "Extra-header:" \ |
| 4983 | -c "HTTP/1.0 200 OK" |
| 4984 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4985 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4986 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 4987 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4988 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 4989 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4990 | 0 \ |
| 4991 | -s "Extra-header:" \ |
| 4992 | -c "HTTP/1.0 200 OK" |
| 4993 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4994 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4995 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 4996 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4997 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 4998 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4999 | 0 \ |
| 5000 | -s "Extra-header:" \ |
| 5001 | -c "HTTP/1.0 200 OK" |
| 5002 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5003 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 5004 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 5005 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5006 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 5007 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5008 | 0 \ |
| 5009 | -s "Extra-header:" \ |
| 5010 | -c "HTTP/1.0 200 OK" |
| 5011 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5012 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5013 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 5014 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5015 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 5016 | auth_mode=required" \ |
| 5017 | "$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] | 5018 | 0 \ |
| 5019 | -s "Extra-header:" \ |
| 5020 | -c "HTTP/1.0 200 OK" |
| 5021 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5022 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 5023 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 5024 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5025 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5026 | psk=abc123 debug_level=3" \ |
| 5027 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5028 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5029 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5030 | 0 \ |
| 5031 | -s "a session has been resumed" \ |
| 5032 | -c "a session has been resumed" \ |
| 5033 | -s "Extra-header:" \ |
| 5034 | -c "HTTP/1.0 200 OK" |
| 5035 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5036 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 5037 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 5038 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5039 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5040 | psk=abc123 debug_level=3 nbio=2" \ |
| 5041 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5042 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5043 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 5044 | 0 \ |
| 5045 | -s "a session has been resumed" \ |
| 5046 | -c "a session has been resumed" \ |
| 5047 | -s "Extra-header:" \ |
| 5048 | -c "HTTP/1.0 200 OK" |
| 5049 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5050 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5051 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5052 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5053 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5054 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5055 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5056 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5057 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5058 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5059 | 0 \ |
| 5060 | -c "=> renegotiate" \ |
| 5061 | -s "=> renegotiate" \ |
| 5062 | -s "Extra-header:" \ |
| 5063 | -c "HTTP/1.0 200 OK" |
| 5064 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5065 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5066 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5067 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 5068 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5069 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5070 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5071 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5072 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5073 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5074 | 0 \ |
| 5075 | -c "=> renegotiate" \ |
| 5076 | -s "=> renegotiate" \ |
| 5077 | -s "Extra-header:" \ |
| 5078 | -c "HTTP/1.0 200 OK" |
| 5079 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5080 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5081 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5082 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5083 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5084 | "$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] | 5085 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5086 | debug_level=2" \ |
| 5087 | "$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] | 5088 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5089 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5090 | 0 \ |
| 5091 | -c "=> renegotiate" \ |
| 5092 | -s "=> renegotiate" \ |
| 5093 | -s "Extra-header:" \ |
| 5094 | -c "HTTP/1.0 200 OK" |
| 5095 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5096 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5098 | 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] | 5099 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5100 | "$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] | 5101 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5102 | debug_level=2 nbio=2" \ |
| 5103 | "$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] | 5104 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5105 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5106 | 0 \ |
| 5107 | -c "=> renegotiate" \ |
| 5108 | -s "=> renegotiate" \ |
| 5109 | -s "Extra-header:" \ |
| 5110 | -c "HTTP/1.0 200 OK" |
| 5111 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5112 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5113 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5114 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5115 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5116 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5117 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5118 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5119 | -c "HTTP/1.0 200 OK" |
| 5120 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5121 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5122 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5123 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 5124 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5125 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5126 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5127 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5128 | -c "HTTP/1.0 200 OK" |
| 5129 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5130 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5131 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5132 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 5133 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5134 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5135 | "$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] | 5136 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5137 | -c "HTTP/1.0 200 OK" |
| 5138 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5139 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5140 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5141 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5142 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 5143 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5144 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5145 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5146 | 0 \ |
| 5147 | -s "Extra-header:" \ |
| 5148 | -c "Extra-header:" |
| 5149 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5150 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5151 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5152 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5153 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 5154 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5155 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5156 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5157 | 0 \ |
| 5158 | -s "Extra-header:" \ |
| 5159 | -c "Extra-header:" |
| 5160 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5161 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5162 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5163 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5164 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 5165 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5166 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5167 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5168 | 0 \ |
| 5169 | -s "Extra-header:" \ |
| 5170 | -c "Extra-header:" |
| 5171 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5172 | # Final report |
| 5173 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5174 | echo "------------------------------------------------------------------------" |
| 5175 | |
| 5176 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5177 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5178 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5179 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5180 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 5181 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 5182 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5183 | |
| 5184 | exit $FAILS |