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 | 3c9e2b5 | 2018-01-08 12:38:15 +0100 | [diff] [blame] | 335 | echo "Warning: lsof not available, wait_server_start = sleep $START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 336 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 337 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 338 | } |
| 339 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 340 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 341 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 342 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 343 | # acceptable bounds |
| 344 | check_server_hello_time() { |
| 345 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 346 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 347 | # Get the Unix timestamp for now |
| 348 | CUR_TIME=$(date +'%s') |
| 349 | THRESHOLD_IN_SECS=300 |
| 350 | |
| 351 | # Check if the ServerHello time was printed |
| 352 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 353 | return 1 |
| 354 | fi |
| 355 | |
| 356 | # Check the time in ServerHello is within acceptable bounds |
| 357 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 358 | # The time in ServerHello is at least 5 minutes before now |
| 359 | return 1 |
| 360 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 361 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 362 | return 1 |
| 363 | else |
| 364 | return 0 |
| 365 | fi |
| 366 | } |
| 367 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 368 | # wait for client to terminate and set CLI_EXIT |
| 369 | # must be called right after starting the client |
| 370 | wait_client_done() { |
| 371 | CLI_PID=$! |
| 372 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 373 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 374 | CLI_DELAY_FACTOR=1 |
| 375 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 376 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 377 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 378 | |
| 379 | wait $CLI_PID |
| 380 | CLI_EXIT=$? |
| 381 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 382 | kill $DOG_PID >/dev/null 2>&1 |
| 383 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 384 | |
| 385 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 386 | |
| 387 | sleep $SRV_DELAY_SECONDS |
| 388 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 389 | } |
| 390 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 391 | # check if the given command uses dtls and sets global variable DTLS |
| 392 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 393 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 394 | DTLS=1 |
| 395 | else |
| 396 | DTLS=0 |
| 397 | fi |
| 398 | } |
| 399 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 400 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 401 | # Options: -s pattern pattern that must be present in server output |
| 402 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 403 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 404 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 405 | # -S pattern pattern that must be absent in server output |
| 406 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 407 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 408 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 409 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 410 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 411 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 412 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 413 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 414 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 415 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 416 | return |
| 417 | fi |
| 418 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 419 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 420 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 421 | # Do we only run numbered tests? |
| 422 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 423 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 424 | else |
| 425 | SKIP_NEXT="YES" |
| 426 | fi |
| 427 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 428 | # should we skip? |
| 429 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 430 | SKIP_NEXT="NO" |
| 431 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 432 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 433 | return |
| 434 | fi |
| 435 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 436 | # does this test use a proxy? |
| 437 | if [ "X$1" = "X-p" ]; then |
| 438 | PXY_CMD="$2" |
| 439 | shift 2 |
| 440 | else |
| 441 | PXY_CMD="" |
| 442 | fi |
| 443 | |
| 444 | # get commands and client output |
| 445 | SRV_CMD="$1" |
| 446 | CLI_CMD="$2" |
| 447 | CLI_EXPECT="$3" |
| 448 | shift 3 |
| 449 | |
| 450 | # fix client port |
| 451 | if [ -n "$PXY_CMD" ]; then |
| 452 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 453 | else |
| 454 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 455 | fi |
| 456 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 457 | # update DTLS variable |
| 458 | detect_dtls "$SRV_CMD" |
| 459 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 460 | # prepend valgrind to our commands if active |
| 461 | if [ "$MEMCHECK" -gt 0 ]; then |
| 462 | if is_polar "$SRV_CMD"; then |
| 463 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 464 | fi |
| 465 | if is_polar "$CLI_CMD"; then |
| 466 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 467 | fi |
| 468 | fi |
| 469 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 470 | TIMES_LEFT=2 |
| 471 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 472 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 473 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 474 | # run the commands |
| 475 | if [ -n "$PXY_CMD" ]; then |
| 476 | echo "$PXY_CMD" > $PXY_OUT |
| 477 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 478 | PXY_PID=$! |
| 479 | # assume proxy starts faster than server |
| 480 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 481 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 482 | check_osrv_dtls |
| 483 | echo "$SRV_CMD" > $SRV_OUT |
| 484 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 485 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 486 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 487 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 488 | echo "$CLI_CMD" > $CLI_OUT |
| 489 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 490 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 491 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 492 | sleep 0.05 |
| 493 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 494 | # terminate the server (and the proxy) |
| 495 | kill $SRV_PID |
| 496 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 497 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 498 | if [ -n "$PXY_CMD" ]; then |
| 499 | kill $PXY_PID >/dev/null 2>&1 |
| 500 | wait $PXY_PID |
| 501 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 502 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 503 | # retry only on timeouts |
| 504 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 505 | printf "RETRY " |
| 506 | else |
| 507 | TIMES_LEFT=0 |
| 508 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 509 | done |
| 510 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 511 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 512 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 513 | # expected client exit to incorrectly succeed in case of catastrophic |
| 514 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 515 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 516 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 517 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 518 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 519 | return |
| 520 | fi |
| 521 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 522 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 523 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 524 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 525 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 526 | return |
| 527 | fi |
| 528 | fi |
| 529 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 530 | # check server exit code |
| 531 | if [ $? != 0 ]; then |
| 532 | fail "server fail" |
| 533 | return |
| 534 | fi |
| 535 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 536 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 537 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 538 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 539 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 540 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 541 | return |
| 542 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 543 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 544 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 545 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 546 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 547 | while [ $# -gt 0 ] |
| 548 | do |
| 549 | case $1 in |
| 550 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 551 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 552 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 553 | return |
| 554 | fi |
| 555 | ;; |
| 556 | |
| 557 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 558 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 559 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 560 | return |
| 561 | fi |
| 562 | ;; |
| 563 | |
| 564 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 565 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 566 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 567 | return |
| 568 | fi |
| 569 | ;; |
| 570 | |
| 571 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 572 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 573 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 574 | return |
| 575 | fi |
| 576 | ;; |
| 577 | |
| 578 | # The filtering in the following two options (-u and -U) do the following |
| 579 | # - ignore valgrind output |
| 580 | # - filter out everything but lines right after the pattern occurances |
| 581 | # - keep one of each non-unique line |
| 582 | # - count how many lines remain |
| 583 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 584 | # if there were no duplicates. |
| 585 | "-U") |
| 586 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 587 | fail "lines following pattern '$2' must be unique in Server output" |
| 588 | return |
| 589 | fi |
| 590 | ;; |
| 591 | |
| 592 | "-u") |
| 593 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 594 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 595 | return |
| 596 | fi |
| 597 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 598 | "-F") |
| 599 | if ! $2 "$SRV_OUT"; then |
| 600 | fail "function call to '$2' failed on Server output" |
| 601 | return |
| 602 | fi |
| 603 | ;; |
| 604 | "-f") |
| 605 | if ! $2 "$CLI_OUT"; then |
| 606 | fail "function call to '$2' failed on Client output" |
| 607 | return |
| 608 | fi |
| 609 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 610 | |
| 611 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 612 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 613 | exit 1 |
| 614 | esac |
| 615 | shift 2 |
| 616 | done |
| 617 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 618 | # check valgrind's results |
| 619 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 620 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 621 | fail "Server has memory errors" |
| 622 | return |
| 623 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 624 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 625 | fail "Client has memory errors" |
| 626 | return |
| 627 | fi |
| 628 | fi |
| 629 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 630 | # if we're here, everything is ok |
| 631 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 632 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 633 | mv $SRV_OUT o-srv-${TESTS}.log |
| 634 | mv $CLI_OUT o-cli-${TESTS}.log |
| 635 | fi |
| 636 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 637 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 638 | } |
| 639 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 640 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 641 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 642 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 643 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 644 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 645 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 646 | exit 1 |
| 647 | } |
| 648 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 649 | # |
| 650 | # MAIN |
| 651 | # |
| 652 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 653 | get_options "$@" |
| 654 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 655 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 656 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 657 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 658 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 659 | if [ ! -x "$P_SRV_BIN" ]; then |
| 660 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 661 | exit 1 |
| 662 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 663 | if [ ! -x "$P_CLI_BIN" ]; then |
| 664 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 665 | exit 1 |
| 666 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 667 | if [ ! -x "$P_PXY_BIN" ]; then |
| 668 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 669 | exit 1 |
| 670 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 671 | if [ "$MEMCHECK" -gt 0 ]; then |
| 672 | if which valgrind >/dev/null 2>&1; then :; else |
| 673 | echo "Memcheck not possible. Valgrind not found" |
| 674 | exit 1 |
| 675 | fi |
| 676 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 677 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 678 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 679 | exit 1 |
| 680 | fi |
| 681 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 682 | # used by watchdog |
| 683 | MAIN_PID="$$" |
| 684 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 685 | # We use somewhat arbitrary delays for tests: |
| 686 | # - how long do we wait for the server to start (when lsof not available)? |
| 687 | # - how long do we allow for the client to finish? |
| 688 | # (not to check performance, just to avoid waiting indefinitely) |
| 689 | # Things are slower with valgrind, so give extra time here. |
| 690 | # |
| 691 | # Note: without lsof, there is a trade-off between the running time of this |
| 692 | # script and the risk of spurious errors because we didn't wait long enough. |
| 693 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 694 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 695 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 696 | START_DELAY=6 |
| 697 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 698 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 699 | START_DELAY=2 |
| 700 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 701 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 702 | |
| 703 | # some particular tests need more time: |
| 704 | # - for the client, we multiply the usual watchdog limit by a factor |
| 705 | # - for the server, we sleep for a number of seconds after the client exits |
| 706 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 707 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 708 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 709 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 710 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 711 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 712 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 713 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 714 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 715 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 716 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 717 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 718 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 719 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 720 | # Allow SHA-1, because many of our test certificates use it |
| 721 | P_SRV="$P_SRV allow_sha1=1" |
| 722 | P_CLI="$P_CLI allow_sha1=1" |
| 723 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 724 | # Also pick a unique name for intermediate files |
| 725 | SRV_OUT="srv_out.$$" |
| 726 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 727 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 728 | SESSION="session.$$" |
| 729 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 730 | SKIP_NEXT="NO" |
| 731 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 732 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 733 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 734 | # Basic test |
| 735 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 736 | # Checks that: |
| 737 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 738 | # - the expected (highest security) parameters are selected |
| 739 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 740 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 741 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 742 | "$P_CLI" \ |
| 743 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 744 | -s "Protocol is TLSv1.2" \ |
| 745 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 746 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 747 | -s "ECDHE curve: secp521r1" \ |
| 748 | -S "error" \ |
| 749 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 750 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 751 | run_test "Default, DTLS" \ |
| 752 | "$P_SRV dtls=1" \ |
| 753 | "$P_CLI dtls=1" \ |
| 754 | 0 \ |
| 755 | -s "Protocol is DTLSv1.2" \ |
| 756 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" |
| 757 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 758 | # Test current time in ServerHello |
| 759 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 760 | run_test "Default, ServerHello contains gmt_unix_time" \ |
| 761 | "$P_SRV debug_level=3" \ |
| 762 | "$P_CLI debug_level=3" \ |
| 763 | 0 \ |
| 764 | -s "Protocol is TLSv1.2" \ |
| 765 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 766 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 767 | -s "ECDHE curve: secp521r1" \ |
| 768 | -S "error" \ |
| 769 | -C "error" \ |
| 770 | -f "check_server_hello_time" \ |
| 771 | -F "check_server_hello_time" |
| 772 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 773 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 774 | run_test "Unique IV in GCM" \ |
| 775 | "$P_SRV exchanges=20 debug_level=4" \ |
| 776 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 777 | 0 \ |
| 778 | -u "IV used" \ |
| 779 | -U "IV used" |
| 780 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 781 | # Tests for rc4 option |
| 782 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 783 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 784 | run_test "RC4: server disabled, client enabled" \ |
| 785 | "$P_SRV" \ |
| 786 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 787 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 788 | -s "SSL - The server has no ciphersuites in common" |
| 789 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 790 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 791 | run_test "RC4: server half, client enabled" \ |
| 792 | "$P_SRV arc4=1" \ |
| 793 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 794 | 1 \ |
| 795 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 796 | |
| 797 | run_test "RC4: server enabled, client disabled" \ |
| 798 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 799 | "$P_CLI" \ |
| 800 | 1 \ |
| 801 | -s "SSL - The server has no ciphersuites in common" |
| 802 | |
| 803 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 804 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 805 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 806 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 807 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 808 | -S "SSL - The server has no ciphersuites in common" |
| 809 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 810 | # Tests for SHA-1 support |
| 811 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 812 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 813 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 814 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 815 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 816 | 1 \ |
| 817 | -c "The certificate is signed with an unacceptable hash" |
| 818 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 819 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 820 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 821 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 822 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 823 | 0 |
| 824 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 825 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 826 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 827 | "$P_CLI allow_sha1=1" \ |
| 828 | 0 |
| 829 | |
| 830 | run_test "SHA-256 allowed by default in server certificate" \ |
| 831 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 832 | "$P_CLI allow_sha1=0" \ |
| 833 | 0 |
| 834 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 835 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 836 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 837 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 838 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 839 | 1 \ |
| 840 | -s "The certificate is signed with an unacceptable hash" |
| 841 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 842 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 843 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 844 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 845 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 846 | 0 |
| 847 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 848 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 849 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 850 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 851 | 0 |
| 852 | |
| 853 | run_test "SHA-256 allowed by default in client certificate" \ |
| 854 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 855 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 856 | 0 |
| 857 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 858 | # Tests for Truncated HMAC extension |
| 859 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 860 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 861 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 862 | "$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] | 863 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 864 | -s "dumping 'expected mac' (20 bytes)" \ |
| 865 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 866 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 867 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 868 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 869 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 870 | "$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] | 871 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 872 | -s "dumping 'expected mac' (20 bytes)" \ |
| 873 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 874 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 875 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 876 | run_test "Truncated HMAC: client enabled, server default" \ |
| 877 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 878 | "$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] | 879 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 880 | -s "dumping 'expected mac' (20 bytes)" \ |
| 881 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 882 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 883 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 884 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 885 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 886 | "$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] | 887 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 888 | -s "dumping 'expected mac' (20 bytes)" \ |
| 889 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 890 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 891 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 892 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 893 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 894 | "$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] | 895 | 0 \ |
| 896 | -s "dumping 'expected mac' (20 bytes)" \ |
| 897 | -S "dumping 'expected mac' (10 bytes)" |
| 898 | |
| 899 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 900 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 901 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 902 | "$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] | 903 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 904 | -S "dumping 'expected mac' (20 bytes)" \ |
| 905 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 906 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 907 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 908 | "$P_SRV dtls=1 debug_level=4" \ |
| 909 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 910 | 0 \ |
| 911 | -s "dumping 'expected mac' (20 bytes)" \ |
| 912 | -S "dumping 'expected mac' (10 bytes)" |
| 913 | |
| 914 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 915 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 916 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 917 | "$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] | 918 | 0 \ |
| 919 | -s "dumping 'expected mac' (20 bytes)" \ |
| 920 | -S "dumping 'expected mac' (10 bytes)" |
| 921 | |
| 922 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 923 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 924 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 925 | "$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] | 926 | 0 \ |
| 927 | -s "dumping 'expected mac' (20 bytes)" \ |
| 928 | -S "dumping 'expected mac' (10 bytes)" |
| 929 | |
| 930 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 931 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 932 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 933 | "$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] | 934 | 0 \ |
| 935 | -s "dumping 'expected mac' (20 bytes)" \ |
| 936 | -S "dumping 'expected mac' (10 bytes)" |
| 937 | |
| 938 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 939 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 940 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 941 | "$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] | 942 | 0 \ |
| 943 | -s "dumping 'expected mac' (20 bytes)" \ |
| 944 | -S "dumping 'expected mac' (10 bytes)" |
| 945 | |
| 946 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 947 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 948 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 949 | "$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] | 950 | 0 \ |
| 951 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 952 | -s "dumping 'expected mac' (10 bytes)" |
| 953 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 954 | # Tests for Encrypt-then-MAC extension |
| 955 | |
| 956 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 957 | "$P_SRV debug_level=3 \ |
| 958 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 959 | "$P_CLI debug_level=3" \ |
| 960 | 0 \ |
| 961 | -c "client hello, adding encrypt_then_mac extension" \ |
| 962 | -s "found encrypt then mac extension" \ |
| 963 | -s "server hello, adding encrypt then mac extension" \ |
| 964 | -c "found encrypt_then_mac extension" \ |
| 965 | -c "using encrypt then mac" \ |
| 966 | -s "using encrypt then mac" |
| 967 | |
| 968 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 969 | "$P_SRV debug_level=3 etm=0 \ |
| 970 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 971 | "$P_CLI debug_level=3 etm=1" \ |
| 972 | 0 \ |
| 973 | -c "client hello, adding encrypt_then_mac extension" \ |
| 974 | -s "found encrypt then mac extension" \ |
| 975 | -S "server hello, adding encrypt then mac extension" \ |
| 976 | -C "found encrypt_then_mac extension" \ |
| 977 | -C "using encrypt then mac" \ |
| 978 | -S "using encrypt then mac" |
| 979 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 980 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 981 | "$P_SRV debug_level=3 etm=1 \ |
| 982 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 983 | "$P_CLI debug_level=3 etm=1" \ |
| 984 | 0 \ |
| 985 | -c "client hello, adding encrypt_then_mac extension" \ |
| 986 | -s "found encrypt then mac extension" \ |
| 987 | -S "server hello, adding encrypt then mac extension" \ |
| 988 | -C "found encrypt_then_mac extension" \ |
| 989 | -C "using encrypt then mac" \ |
| 990 | -S "using encrypt then mac" |
| 991 | |
| 992 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 993 | "$P_SRV debug_level=3 etm=1 \ |
| 994 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 995 | "$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] | 996 | 0 \ |
| 997 | -c "client hello, adding encrypt_then_mac extension" \ |
| 998 | -s "found encrypt then mac extension" \ |
| 999 | -S "server hello, adding encrypt then mac extension" \ |
| 1000 | -C "found encrypt_then_mac extension" \ |
| 1001 | -C "using encrypt then mac" \ |
| 1002 | -S "using encrypt then mac" |
| 1003 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1004 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1005 | "$P_SRV debug_level=3 etm=1 \ |
| 1006 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1007 | "$P_CLI debug_level=3 etm=0" \ |
| 1008 | 0 \ |
| 1009 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1010 | -S "found encrypt then mac extension" \ |
| 1011 | -S "server hello, adding encrypt then mac extension" \ |
| 1012 | -C "found encrypt_then_mac extension" \ |
| 1013 | -C "using encrypt then mac" \ |
| 1014 | -S "using encrypt then mac" |
| 1015 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1016 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1017 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1018 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1019 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1020 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1021 | 0 \ |
| 1022 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1023 | -S "found encrypt then mac extension" \ |
| 1024 | -S "server hello, adding encrypt then mac extension" \ |
| 1025 | -C "found encrypt_then_mac extension" \ |
| 1026 | -C "using encrypt then mac" \ |
| 1027 | -S "using encrypt then mac" |
| 1028 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1029 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1030 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1031 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1032 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1033 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1034 | 0 \ |
| 1035 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1036 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1037 | -S "server hello, adding encrypt then mac extension" \ |
| 1038 | -C "found encrypt_then_mac extension" \ |
| 1039 | -C "using encrypt then mac" \ |
| 1040 | -S "using encrypt then mac" |
| 1041 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1042 | # Tests for Extended Master Secret extension |
| 1043 | |
| 1044 | run_test "Extended Master Secret: default" \ |
| 1045 | "$P_SRV debug_level=3" \ |
| 1046 | "$P_CLI debug_level=3" \ |
| 1047 | 0 \ |
| 1048 | -c "client hello, adding extended_master_secret extension" \ |
| 1049 | -s "found extended master secret extension" \ |
| 1050 | -s "server hello, adding extended master secret extension" \ |
| 1051 | -c "found extended_master_secret extension" \ |
| 1052 | -c "using extended master secret" \ |
| 1053 | -s "using extended master secret" |
| 1054 | |
| 1055 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1056 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1057 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1058 | 0 \ |
| 1059 | -c "client hello, adding extended_master_secret extension" \ |
| 1060 | -s "found extended master secret extension" \ |
| 1061 | -S "server hello, adding extended master secret extension" \ |
| 1062 | -C "found extended_master_secret extension" \ |
| 1063 | -C "using extended master secret" \ |
| 1064 | -S "using extended master secret" |
| 1065 | |
| 1066 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1067 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1068 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1069 | 0 \ |
| 1070 | -C "client hello, adding extended_master_secret extension" \ |
| 1071 | -S "found extended master secret extension" \ |
| 1072 | -S "server hello, adding extended master secret extension" \ |
| 1073 | -C "found extended_master_secret extension" \ |
| 1074 | -C "using extended master secret" \ |
| 1075 | -S "using extended master secret" |
| 1076 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1077 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1078 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1079 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1080 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1081 | 0 \ |
| 1082 | -C "client hello, adding extended_master_secret extension" \ |
| 1083 | -S "found extended master secret extension" \ |
| 1084 | -S "server hello, adding extended master secret extension" \ |
| 1085 | -C "found extended_master_secret extension" \ |
| 1086 | -C "using extended master secret" \ |
| 1087 | -S "using extended master secret" |
| 1088 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1089 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1090 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1091 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1092 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1093 | 0 \ |
| 1094 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1095 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1096 | -S "server hello, adding extended master secret extension" \ |
| 1097 | -C "found extended_master_secret extension" \ |
| 1098 | -C "using extended master secret" \ |
| 1099 | -S "using extended master secret" |
| 1100 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1101 | # Tests for FALLBACK_SCSV |
| 1102 | |
| 1103 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1104 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1105 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1106 | 0 \ |
| 1107 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1108 | -S "received FALLBACK_SCSV" \ |
| 1109 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1110 | -C "is a fatal alert message (msg 86)" |
| 1111 | |
| 1112 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1113 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1114 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1115 | 0 \ |
| 1116 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1117 | -S "received FALLBACK_SCSV" \ |
| 1118 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1119 | -C "is a fatal alert message (msg 86)" |
| 1120 | |
| 1121 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1122 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1123 | "$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] | 1124 | 1 \ |
| 1125 | -c "adding FALLBACK_SCSV" \ |
| 1126 | -s "received FALLBACK_SCSV" \ |
| 1127 | -s "inapropriate fallback" \ |
| 1128 | -c "is a fatal alert message (msg 86)" |
| 1129 | |
| 1130 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1131 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1132 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1133 | 0 \ |
| 1134 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1135 | -s "received FALLBACK_SCSV" \ |
| 1136 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1137 | -C "is a fatal alert message (msg 86)" |
| 1138 | |
| 1139 | requires_openssl_with_fallback_scsv |
| 1140 | run_test "Fallback SCSV: default, openssl server" \ |
| 1141 | "$O_SRV" \ |
| 1142 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1143 | 0 \ |
| 1144 | -C "adding FALLBACK_SCSV" \ |
| 1145 | -C "is a fatal alert message (msg 86)" |
| 1146 | |
| 1147 | requires_openssl_with_fallback_scsv |
| 1148 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1149 | "$O_SRV" \ |
| 1150 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1151 | 1 \ |
| 1152 | -c "adding FALLBACK_SCSV" \ |
| 1153 | -c "is a fatal alert message (msg 86)" |
| 1154 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1155 | requires_openssl_with_fallback_scsv |
| 1156 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1157 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1158 | "$O_CLI -tls1_1" \ |
| 1159 | 0 \ |
| 1160 | -S "received FALLBACK_SCSV" \ |
| 1161 | -S "inapropriate fallback" |
| 1162 | |
| 1163 | requires_openssl_with_fallback_scsv |
| 1164 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1165 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1166 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1167 | 1 \ |
| 1168 | -s "received FALLBACK_SCSV" \ |
| 1169 | -s "inapropriate fallback" |
| 1170 | |
| 1171 | requires_openssl_with_fallback_scsv |
| 1172 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1173 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1174 | "$O_CLI -fallback_scsv" \ |
| 1175 | 0 \ |
| 1176 | -s "received FALLBACK_SCSV" \ |
| 1177 | -S "inapropriate fallback" |
| 1178 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1179 | ## ClientHello generated with |
| 1180 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1181 | ## then manually twiddling the ciphersuite list. |
| 1182 | ## The ClientHello content is spelled out below as a hex string as |
| 1183 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1184 | ## The expected response is an inappropriate_fallback alert. |
| 1185 | requires_openssl_with_fallback_scsv |
| 1186 | run_test "Fallback SCSV: beginning of list" \ |
| 1187 | "$P_SRV debug_level=2" \ |
| 1188 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1189 | 0 \ |
| 1190 | -s "received FALLBACK_SCSV" \ |
| 1191 | -s "inapropriate fallback" |
| 1192 | |
| 1193 | requires_openssl_with_fallback_scsv |
| 1194 | run_test "Fallback SCSV: end of list" \ |
| 1195 | "$P_SRV debug_level=2" \ |
| 1196 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1197 | 0 \ |
| 1198 | -s "received FALLBACK_SCSV" \ |
| 1199 | -s "inapropriate fallback" |
| 1200 | |
| 1201 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1202 | requires_openssl_with_fallback_scsv |
| 1203 | run_test "Fallback SCSV: not in list" \ |
| 1204 | "$P_SRV debug_level=2" \ |
| 1205 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1206 | 0 \ |
| 1207 | -S "received FALLBACK_SCSV" \ |
| 1208 | -S "inapropriate fallback" |
| 1209 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1210 | # Tests for CBC 1/n-1 record splitting |
| 1211 | |
| 1212 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1213 | "$P_SRV" \ |
| 1214 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1215 | request_size=123 force_version=tls1_2" \ |
| 1216 | 0 \ |
| 1217 | -s "Read from client: 123 bytes read" \ |
| 1218 | -S "Read from client: 1 bytes read" \ |
| 1219 | -S "122 bytes read" |
| 1220 | |
| 1221 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1222 | "$P_SRV" \ |
| 1223 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1224 | request_size=123 force_version=tls1_1" \ |
| 1225 | 0 \ |
| 1226 | -s "Read from client: 123 bytes read" \ |
| 1227 | -S "Read from client: 1 bytes read" \ |
| 1228 | -S "122 bytes read" |
| 1229 | |
| 1230 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1231 | "$P_SRV" \ |
| 1232 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1233 | request_size=123 force_version=tls1" \ |
| 1234 | 0 \ |
| 1235 | -S "Read from client: 123 bytes read" \ |
| 1236 | -s "Read from client: 1 bytes read" \ |
| 1237 | -s "122 bytes read" |
| 1238 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1239 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1240 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1241 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1242 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1243 | request_size=123 force_version=ssl3" \ |
| 1244 | 0 \ |
| 1245 | -S "Read from client: 123 bytes read" \ |
| 1246 | -s "Read from client: 1 bytes read" \ |
| 1247 | -s "122 bytes read" |
| 1248 | |
| 1249 | 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] | 1250 | "$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] | 1251 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1252 | request_size=123 force_version=tls1" \ |
| 1253 | 0 \ |
| 1254 | -s "Read from client: 123 bytes read" \ |
| 1255 | -S "Read from client: 1 bytes read" \ |
| 1256 | -S "122 bytes read" |
| 1257 | |
| 1258 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1259 | "$P_SRV" \ |
| 1260 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1261 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1262 | 0 \ |
| 1263 | -s "Read from client: 123 bytes read" \ |
| 1264 | -S "Read from client: 1 bytes read" \ |
| 1265 | -S "122 bytes read" |
| 1266 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1267 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1268 | "$P_SRV nbio=2" \ |
| 1269 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1270 | request_size=123 force_version=tls1" \ |
| 1271 | 0 \ |
| 1272 | -S "Read from client: 123 bytes read" \ |
| 1273 | -s "Read from client: 1 bytes read" \ |
| 1274 | -s "122 bytes read" |
| 1275 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1276 | # Tests for Session Tickets |
| 1277 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1278 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1279 | "$P_SRV debug_level=3 tickets=1" \ |
| 1280 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1281 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1282 | -c "client hello, adding session ticket extension" \ |
| 1283 | -s "found session ticket extension" \ |
| 1284 | -s "server hello, adding session ticket extension" \ |
| 1285 | -c "found session_ticket extension" \ |
| 1286 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1287 | -S "session successfully restored from cache" \ |
| 1288 | -s "session successfully restored from ticket" \ |
| 1289 | -s "a session has been resumed" \ |
| 1290 | -c "a session has been resumed" |
| 1291 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1292 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1293 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1294 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1295 | 0 \ |
| 1296 | -c "client hello, adding session ticket extension" \ |
| 1297 | -s "found session ticket extension" \ |
| 1298 | -s "server hello, adding session ticket extension" \ |
| 1299 | -c "found session_ticket extension" \ |
| 1300 | -c "parse new session ticket" \ |
| 1301 | -S "session successfully restored from cache" \ |
| 1302 | -s "session successfully restored from ticket" \ |
| 1303 | -s "a session has been resumed" \ |
| 1304 | -c "a session has been resumed" |
| 1305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1306 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1307 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1308 | "$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] | 1309 | 0 \ |
| 1310 | -c "client hello, adding session ticket extension" \ |
| 1311 | -s "found session ticket extension" \ |
| 1312 | -s "server hello, adding session ticket extension" \ |
| 1313 | -c "found session_ticket extension" \ |
| 1314 | -c "parse new session ticket" \ |
| 1315 | -S "session successfully restored from cache" \ |
| 1316 | -S "session successfully restored from ticket" \ |
| 1317 | -S "a session has been resumed" \ |
| 1318 | -C "a session has been resumed" |
| 1319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1320 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1321 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1322 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1323 | 0 \ |
| 1324 | -c "client hello, adding session ticket extension" \ |
| 1325 | -c "found session_ticket extension" \ |
| 1326 | -c "parse new session ticket" \ |
| 1327 | -c "a session has been resumed" |
| 1328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1329 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1330 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1331 | "( $O_CLI -sess_out $SESSION; \ |
| 1332 | $O_CLI -sess_in $SESSION; \ |
| 1333 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1334 | 0 \ |
| 1335 | -s "found session ticket extension" \ |
| 1336 | -s "server hello, adding session ticket extension" \ |
| 1337 | -S "session successfully restored from cache" \ |
| 1338 | -s "session successfully restored from ticket" \ |
| 1339 | -s "a session has been resumed" |
| 1340 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1341 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1342 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1343 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1344 | "$P_SRV debug_level=3 tickets=0" \ |
| 1345 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1346 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1347 | -c "client hello, adding session ticket extension" \ |
| 1348 | -s "found session ticket extension" \ |
| 1349 | -S "server hello, adding session ticket extension" \ |
| 1350 | -C "found session_ticket extension" \ |
| 1351 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1352 | -s "session successfully restored from cache" \ |
| 1353 | -S "session successfully restored from ticket" \ |
| 1354 | -s "a session has been resumed" \ |
| 1355 | -c "a session has been resumed" |
| 1356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1357 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1358 | "$P_SRV debug_level=3 tickets=1" \ |
| 1359 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1360 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1361 | -C "client hello, adding session ticket extension" \ |
| 1362 | -S "found session ticket extension" \ |
| 1363 | -S "server hello, adding session ticket extension" \ |
| 1364 | -C "found session_ticket extension" \ |
| 1365 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1366 | -s "session successfully restored from cache" \ |
| 1367 | -S "session successfully restored from ticket" \ |
| 1368 | -s "a session has been resumed" \ |
| 1369 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1370 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1371 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1372 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1373 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1374 | 0 \ |
| 1375 | -S "session successfully restored from cache" \ |
| 1376 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1377 | -S "a session has been resumed" \ |
| 1378 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1380 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1381 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1382 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1383 | 0 \ |
| 1384 | -s "session successfully restored from cache" \ |
| 1385 | -S "session successfully restored from ticket" \ |
| 1386 | -s "a session has been resumed" \ |
| 1387 | -c "a session has been resumed" |
| 1388 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1389 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1390 | "$P_SRV debug_level=3 tickets=0" \ |
| 1391 | "$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] | 1392 | 0 \ |
| 1393 | -s "session successfully restored from cache" \ |
| 1394 | -S "session successfully restored from ticket" \ |
| 1395 | -s "a session has been resumed" \ |
| 1396 | -c "a session has been resumed" |
| 1397 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1398 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1399 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1400 | "$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] | 1401 | 0 \ |
| 1402 | -S "session successfully restored from cache" \ |
| 1403 | -S "session successfully restored from ticket" \ |
| 1404 | -S "a session has been resumed" \ |
| 1405 | -C "a session has been resumed" |
| 1406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1407 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1408 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1409 | "$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] | 1410 | 0 \ |
| 1411 | -s "session successfully restored from cache" \ |
| 1412 | -S "session successfully restored from ticket" \ |
| 1413 | -s "a session has been resumed" \ |
| 1414 | -c "a session has been resumed" |
| 1415 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1416 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1417 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1418 | "( $O_CLI -sess_out $SESSION; \ |
| 1419 | $O_CLI -sess_in $SESSION; \ |
| 1420 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1421 | 0 \ |
| 1422 | -s "found session ticket extension" \ |
| 1423 | -S "server hello, adding session ticket extension" \ |
| 1424 | -s "session successfully restored from cache" \ |
| 1425 | -S "session successfully restored from ticket" \ |
| 1426 | -s "a session has been resumed" |
| 1427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1428 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1429 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1430 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1431 | 0 \ |
| 1432 | -C "found session_ticket extension" \ |
| 1433 | -C "parse new session ticket" \ |
| 1434 | -c "a session has been resumed" |
| 1435 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1436 | # Tests for Max Fragment Length extension |
| 1437 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1438 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1439 | 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] | 1440 | exit 1 |
| 1441 | fi |
| 1442 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1443 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1444 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1445 | fi |
| 1446 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1447 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1448 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1449 | "$P_SRV debug_level=3" \ |
| 1450 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1451 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1452 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1453 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1454 | -C "client hello, adding max_fragment_length extension" \ |
| 1455 | -S "found max fragment length extension" \ |
| 1456 | -S "server hello, max_fragment_length extension" \ |
| 1457 | -C "found max_fragment_length extension" |
| 1458 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1459 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1460 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1461 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1462 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1463 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1464 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1465 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1466 | -C "client hello, adding max_fragment_length extension" \ |
| 1467 | -S "found max fragment length extension" \ |
| 1468 | -S "server hello, max_fragment_length extension" \ |
| 1469 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1470 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1471 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1472 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1473 | |
| 1474 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1475 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1476 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1477 | "$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] | 1478 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1479 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1480 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1481 | -C "client hello, adding max_fragment_length extension" \ |
| 1482 | -S "found max fragment length extension" \ |
| 1483 | -S "server hello, max_fragment_length extension" \ |
| 1484 | -C "found max_fragment_length extension" \ |
| 1485 | -c "fragment larger than.*maximum " |
| 1486 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1487 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1488 | # (session fragment length will be 16384 regardless of mbedtls |
| 1489 | # content length configuration.) |
| 1490 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1491 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1492 | run_test "Max fragment length: disabled, larger message" \ |
| 1493 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1494 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1495 | 0 \ |
| 1496 | -C "Maximum fragment length is 16384" \ |
| 1497 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1498 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1499 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1500 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1501 | |
| 1502 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1503 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1504 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1505 | "$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] | 1506 | 1 \ |
| 1507 | -C "Maximum fragment length is 16384" \ |
| 1508 | -S "Maximum fragment length is 16384" \ |
| 1509 | -c "fragment larger than.*maximum " |
| 1510 | |
| 1511 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1512 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1513 | "$P_SRV debug_level=3" \ |
| 1514 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1515 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1516 | -c "Maximum fragment length is 4096" \ |
| 1517 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1518 | -c "client hello, adding max_fragment_length extension" \ |
| 1519 | -s "found max fragment length extension" \ |
| 1520 | -s "server hello, max_fragment_length extension" \ |
| 1521 | -c "found max_fragment_length extension" |
| 1522 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1523 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1524 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1525 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1526 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1527 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 1528 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1529 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1530 | -C "client hello, adding max_fragment_length extension" \ |
| 1531 | -S "found max fragment length extension" \ |
| 1532 | -S "server hello, max_fragment_length extension" \ |
| 1533 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1534 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1535 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1536 | requires_gnutls |
| 1537 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1538 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1539 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1540 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1541 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1542 | -c "client hello, adding max_fragment_length extension" \ |
| 1543 | -c "found max_fragment_length extension" |
| 1544 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1545 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1546 | run_test "Max fragment length: client, message just fits" \ |
| 1547 | "$P_SRV debug_level=3" \ |
| 1548 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1549 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1550 | -c "Maximum fragment length is 2048" \ |
| 1551 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1552 | -c "client hello, adding max_fragment_length extension" \ |
| 1553 | -s "found max fragment length extension" \ |
| 1554 | -s "server hello, max_fragment_length extension" \ |
| 1555 | -c "found max_fragment_length extension" \ |
| 1556 | -c "2048 bytes written in 1 fragments" \ |
| 1557 | -s "2048 bytes read" |
| 1558 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1559 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1560 | run_test "Max fragment length: client, larger message" \ |
| 1561 | "$P_SRV debug_level=3" \ |
| 1562 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1563 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1564 | -c "Maximum fragment length is 2048" \ |
| 1565 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1566 | -c "client hello, adding max_fragment_length extension" \ |
| 1567 | -s "found max fragment length extension" \ |
| 1568 | -s "server hello, max_fragment_length extension" \ |
| 1569 | -c "found max_fragment_length extension" \ |
| 1570 | -c "2345 bytes written in 2 fragments" \ |
| 1571 | -s "2048 bytes read" \ |
| 1572 | -s "297 bytes read" |
| 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 | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1575 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1576 | "$P_SRV debug_level=3 dtls=1" \ |
| 1577 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1578 | 1 \ |
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 "fragment larger than.*maximum" |
| 1586 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1587 | # Tests for renegotiation |
| 1588 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1589 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1590 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1591 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1592 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1593 | 0 \ |
| 1594 | -C "client hello, adding renegotiation extension" \ |
| 1595 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1596 | -S "found renegotiation extension" \ |
| 1597 | -s "server hello, secure renegotiation extension" \ |
| 1598 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1599 | -C "=> renegotiate" \ |
| 1600 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1601 | -S "write hello request" |
| 1602 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1603 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1604 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1605 | "$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] | 1606 | "$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] | 1607 | 0 \ |
| 1608 | -c "client hello, adding renegotiation extension" \ |
| 1609 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1610 | -s "found renegotiation extension" \ |
| 1611 | -s "server hello, secure renegotiation extension" \ |
| 1612 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1613 | -c "=> renegotiate" \ |
| 1614 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1615 | -S "write hello request" |
| 1616 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1618 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1619 | "$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] | 1620 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1621 | 0 \ |
| 1622 | -c "client hello, adding renegotiation extension" \ |
| 1623 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1624 | -s "found renegotiation extension" \ |
| 1625 | -s "server hello, secure renegotiation extension" \ |
| 1626 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1627 | -c "=> renegotiate" \ |
| 1628 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1629 | -s "write hello request" |
| 1630 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1631 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1632 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1633 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1635 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1636 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1637 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1638 | 0 \ |
| 1639 | -c "client hello, adding renegotiation extension" \ |
| 1640 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1641 | -s "found renegotiation extension" \ |
| 1642 | -s "server hello, secure renegotiation extension" \ |
| 1643 | -c "found renegotiation extension" \ |
| 1644 | -c "=> renegotiate" \ |
| 1645 | -s "=> renegotiate" \ |
| 1646 | -S "write hello request" \ |
| 1647 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1648 | |
| 1649 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1650 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1651 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1652 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1653 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1654 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1655 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1656 | 0 \ |
| 1657 | -c "client hello, adding renegotiation extension" \ |
| 1658 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1659 | -s "found renegotiation extension" \ |
| 1660 | -s "server hello, secure renegotiation extension" \ |
| 1661 | -c "found renegotiation extension" \ |
| 1662 | -c "=> renegotiate" \ |
| 1663 | -s "=> renegotiate" \ |
| 1664 | -s "write hello request" \ |
| 1665 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1666 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1668 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1669 | "$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] | 1670 | "$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] | 1671 | 0 \ |
| 1672 | -c "client hello, adding renegotiation extension" \ |
| 1673 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1674 | -s "found renegotiation extension" \ |
| 1675 | -s "server hello, secure renegotiation extension" \ |
| 1676 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1677 | -c "=> renegotiate" \ |
| 1678 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1679 | -s "write hello request" |
| 1680 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1682 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1683 | "$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] | 1684 | "$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] | 1685 | 1 \ |
| 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1691 | -c "=> renegotiate" \ |
| 1692 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1693 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1694 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1695 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1696 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1697 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1698 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1699 | "$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] | 1700 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1701 | 0 \ |
| 1702 | -C "client hello, adding renegotiation extension" \ |
| 1703 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1704 | -S "found renegotiation extension" \ |
| 1705 | -s "server hello, secure renegotiation extension" \ |
| 1706 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1707 | -C "=> renegotiate" \ |
| 1708 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1709 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1710 | -S "SSL - An unexpected message was received from our peer" \ |
| 1711 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1712 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1714 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1715 | "$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] | 1716 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1717 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1718 | 0 \ |
| 1719 | -C "client hello, adding renegotiation extension" \ |
| 1720 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1721 | -S "found renegotiation extension" \ |
| 1722 | -s "server hello, secure renegotiation extension" \ |
| 1723 | -c "found renegotiation extension" \ |
| 1724 | -C "=> renegotiate" \ |
| 1725 | -S "=> renegotiate" \ |
| 1726 | -s "write hello request" \ |
| 1727 | -S "SSL - An unexpected message was received from our peer" \ |
| 1728 | -S "failed" |
| 1729 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1730 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1732 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1733 | "$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] | 1734 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1735 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1736 | 0 \ |
| 1737 | -C "client hello, adding renegotiation extension" \ |
| 1738 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1739 | -S "found renegotiation extension" \ |
| 1740 | -s "server hello, secure renegotiation extension" \ |
| 1741 | -c "found renegotiation extension" \ |
| 1742 | -C "=> renegotiate" \ |
| 1743 | -S "=> renegotiate" \ |
| 1744 | -s "write hello request" \ |
| 1745 | -S "SSL - An unexpected message was received from our peer" \ |
| 1746 | -S "failed" |
| 1747 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1748 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1749 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1750 | "$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] | 1751 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1752 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1753 | 0 \ |
| 1754 | -C "client hello, adding renegotiation extension" \ |
| 1755 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1756 | -S "found renegotiation extension" \ |
| 1757 | -s "server hello, secure renegotiation extension" \ |
| 1758 | -c "found renegotiation extension" \ |
| 1759 | -C "=> renegotiate" \ |
| 1760 | -S "=> renegotiate" \ |
| 1761 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1762 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1763 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1765 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1766 | "$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] | 1767 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1768 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1769 | 0 \ |
| 1770 | -c "client hello, adding renegotiation extension" \ |
| 1771 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1772 | -s "found renegotiation extension" \ |
| 1773 | -s "server hello, secure renegotiation extension" \ |
| 1774 | -c "found renegotiation extension" \ |
| 1775 | -c "=> renegotiate" \ |
| 1776 | -s "=> renegotiate" \ |
| 1777 | -s "write hello request" \ |
| 1778 | -S "SSL - An unexpected message was received from our peer" \ |
| 1779 | -S "failed" |
| 1780 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1782 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1783 | "$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] | 1784 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1785 | 0 \ |
| 1786 | -C "client hello, adding renegotiation extension" \ |
| 1787 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1788 | -S "found renegotiation extension" \ |
| 1789 | -s "server hello, secure renegotiation extension" \ |
| 1790 | -c "found renegotiation extension" \ |
| 1791 | -S "record counter limit reached: renegotiate" \ |
| 1792 | -C "=> renegotiate" \ |
| 1793 | -S "=> renegotiate" \ |
| 1794 | -S "write hello request" \ |
| 1795 | -S "SSL - An unexpected message was received from our peer" \ |
| 1796 | -S "failed" |
| 1797 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1798 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1800 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1801 | "$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] | 1802 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1803 | 0 \ |
| 1804 | -c "client hello, adding renegotiation extension" \ |
| 1805 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1806 | -s "found renegotiation extension" \ |
| 1807 | -s "server hello, secure renegotiation extension" \ |
| 1808 | -c "found renegotiation extension" \ |
| 1809 | -s "record counter limit reached: renegotiate" \ |
| 1810 | -c "=> renegotiate" \ |
| 1811 | -s "=> renegotiate" \ |
| 1812 | -s "write hello request" \ |
| 1813 | -S "SSL - An unexpected message was received from our peer" \ |
| 1814 | -S "failed" |
| 1815 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1816 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1817 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1818 | "$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] | 1819 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1820 | 0 \ |
| 1821 | -c "client hello, adding renegotiation extension" \ |
| 1822 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1823 | -s "found renegotiation extension" \ |
| 1824 | -s "server hello, secure renegotiation extension" \ |
| 1825 | -c "found renegotiation extension" \ |
| 1826 | -s "record counter limit reached: renegotiate" \ |
| 1827 | -c "=> renegotiate" \ |
| 1828 | -s "=> renegotiate" \ |
| 1829 | -s "write hello request" \ |
| 1830 | -S "SSL - An unexpected message was received from our peer" \ |
| 1831 | -S "failed" |
| 1832 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1833 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1834 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1835 | "$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] | 1836 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1837 | 0 \ |
| 1838 | -C "client hello, adding renegotiation extension" \ |
| 1839 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1840 | -S "found renegotiation extension" \ |
| 1841 | -s "server hello, secure renegotiation extension" \ |
| 1842 | -c "found renegotiation extension" \ |
| 1843 | -S "record counter limit reached: renegotiate" \ |
| 1844 | -C "=> renegotiate" \ |
| 1845 | -S "=> renegotiate" \ |
| 1846 | -S "write hello request" \ |
| 1847 | -S "SSL - An unexpected message was received from our peer" \ |
| 1848 | -S "failed" |
| 1849 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1851 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1852 | "$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] | 1853 | "$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] | 1854 | 0 \ |
| 1855 | -c "client hello, adding renegotiation extension" \ |
| 1856 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1857 | -s "found renegotiation extension" \ |
| 1858 | -s "server hello, secure renegotiation extension" \ |
| 1859 | -c "found renegotiation extension" \ |
| 1860 | -c "=> renegotiate" \ |
| 1861 | -s "=> renegotiate" \ |
| 1862 | -S "write hello request" |
| 1863 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1864 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1865 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1866 | "$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] | 1867 | "$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] | 1868 | 0 \ |
| 1869 | -c "client hello, adding renegotiation extension" \ |
| 1870 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1871 | -s "found renegotiation extension" \ |
| 1872 | -s "server hello, secure renegotiation extension" \ |
| 1873 | -c "found renegotiation extension" \ |
| 1874 | -c "=> renegotiate" \ |
| 1875 | -s "=> renegotiate" \ |
| 1876 | -s "write hello request" |
| 1877 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1879 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1880 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1881 | "$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] | 1882 | 0 \ |
| 1883 | -c "client hello, adding renegotiation extension" \ |
| 1884 | -c "found renegotiation extension" \ |
| 1885 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1886 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1887 | -C "error" \ |
| 1888 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1889 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1890 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1892 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1893 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1894 | "$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] | 1895 | 0 \ |
| 1896 | -c "client hello, adding renegotiation extension" \ |
| 1897 | -c "found renegotiation extension" \ |
| 1898 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1899 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1900 | -C "error" \ |
| 1901 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1902 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1903 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1905 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1906 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1907 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1908 | 1 \ |
| 1909 | -c "client hello, adding renegotiation extension" \ |
| 1910 | -C "found renegotiation extension" \ |
| 1911 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1912 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1913 | -c "error" \ |
| 1914 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1915 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1916 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1917 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1918 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1919 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1920 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1921 | allow_legacy=0" \ |
| 1922 | 1 \ |
| 1923 | -c "client hello, adding renegotiation extension" \ |
| 1924 | -C "found renegotiation extension" \ |
| 1925 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1926 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1927 | -c "error" \ |
| 1928 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1929 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1930 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1932 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1933 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1934 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1935 | allow_legacy=1" \ |
| 1936 | 0 \ |
| 1937 | -c "client hello, adding renegotiation extension" \ |
| 1938 | -C "found renegotiation extension" \ |
| 1939 | -c "=> renegotiate" \ |
| 1940 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1941 | -C "error" \ |
| 1942 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1943 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1944 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1945 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 1946 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 1947 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1948 | 0 \ |
| 1949 | -c "client hello, adding renegotiation extension" \ |
| 1950 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1951 | -s "found renegotiation extension" \ |
| 1952 | -s "server hello, secure renegotiation extension" \ |
| 1953 | -c "found renegotiation extension" \ |
| 1954 | -c "=> renegotiate" \ |
| 1955 | -s "=> renegotiate" \ |
| 1956 | -S "write hello request" |
| 1957 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1958 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1959 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 1960 | "$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] | 1961 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 1962 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1963 | 0 \ |
| 1964 | -c "client hello, adding renegotiation extension" \ |
| 1965 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1966 | -s "found renegotiation extension" \ |
| 1967 | -s "server hello, secure renegotiation extension" \ |
| 1968 | -c "found renegotiation extension" \ |
| 1969 | -c "=> renegotiate" \ |
| 1970 | -s "=> renegotiate" \ |
| 1971 | -s "write hello request" |
| 1972 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 1974 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 1975 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 1976 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=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 | -s "record counter limit reached: renegotiate" \ |
| 1983 | -c "=> renegotiate" \ |
| 1984 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1985 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 1986 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 1987 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1989 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 1990 | "$G_SRV -u --mtu 4096" \ |
| 1991 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1992 | 0 \ |
| 1993 | -c "client hello, adding renegotiation extension" \ |
| 1994 | -c "found renegotiation extension" \ |
| 1995 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1996 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1997 | -C "error" \ |
| 1998 | -s "Extra-header:" |
| 1999 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2000 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2001 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2002 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2003 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2004 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2005 | "$P_CLI debug_level=3" \ |
| 2006 | 0 \ |
| 2007 | -c "found renegotiation extension" \ |
| 2008 | -C "error" \ |
| 2009 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2010 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2011 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2012 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2013 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2014 | "$P_CLI debug_level=3" \ |
| 2015 | 0 \ |
| 2016 | -C "found renegotiation extension" \ |
| 2017 | -C "error" \ |
| 2018 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2019 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2020 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2021 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2022 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2023 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2024 | 1 \ |
| 2025 | -C "found renegotiation extension" \ |
| 2026 | -c "error" \ |
| 2027 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2028 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2029 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2030 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2031 | "$P_SRV debug_level=3" \ |
| 2032 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2033 | 0 \ |
| 2034 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2035 | -s "server hello, secure renegotiation extension" |
| 2036 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2037 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2038 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2039 | "$P_SRV debug_level=3" \ |
| 2040 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2041 | 0 \ |
| 2042 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2043 | -S "server hello, secure renegotiation extension" |
| 2044 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2045 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2046 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2047 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 2048 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2049 | 1 \ |
| 2050 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2051 | -S "server hello, secure renegotiation extension" |
| 2052 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2053 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2054 | |
| 2055 | requires_gnutls |
| 2056 | run_test "DER format: no trailing bytes" \ |
| 2057 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2058 | key_file=data_files/server5.key" \ |
| 2059 | "$G_CLI " \ |
| 2060 | 0 \ |
| 2061 | -c "Handshake was completed" \ |
| 2062 | |
| 2063 | requires_gnutls |
| 2064 | run_test "DER format: with a trailing zero byte" \ |
| 2065 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2066 | key_file=data_files/server5.key" \ |
| 2067 | "$G_CLI " \ |
| 2068 | 0 \ |
| 2069 | -c "Handshake was completed" \ |
| 2070 | |
| 2071 | requires_gnutls |
| 2072 | run_test "DER format: with a trailing random byte" \ |
| 2073 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2074 | key_file=data_files/server5.key" \ |
| 2075 | "$G_CLI " \ |
| 2076 | 0 \ |
| 2077 | -c "Handshake was completed" \ |
| 2078 | |
| 2079 | requires_gnutls |
| 2080 | run_test "DER format: with 2 trailing random bytes" \ |
| 2081 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2082 | key_file=data_files/server5.key" \ |
| 2083 | "$G_CLI " \ |
| 2084 | 0 \ |
| 2085 | -c "Handshake was completed" \ |
| 2086 | |
| 2087 | requires_gnutls |
| 2088 | run_test "DER format: with 4 trailing random bytes" \ |
| 2089 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2090 | key_file=data_files/server5.key" \ |
| 2091 | "$G_CLI " \ |
| 2092 | 0 \ |
| 2093 | -c "Handshake was completed" \ |
| 2094 | |
| 2095 | requires_gnutls |
| 2096 | run_test "DER format: with 8 trailing random bytes" \ |
| 2097 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2098 | key_file=data_files/server5.key" \ |
| 2099 | "$G_CLI " \ |
| 2100 | 0 \ |
| 2101 | -c "Handshake was completed" \ |
| 2102 | |
| 2103 | requires_gnutls |
| 2104 | run_test "DER format: with 9 trailing random bytes" \ |
| 2105 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2106 | key_file=data_files/server5.key" \ |
| 2107 | "$G_CLI " \ |
| 2108 | 0 \ |
| 2109 | -c "Handshake was completed" \ |
| 2110 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2111 | # Tests for auth_mode |
| 2112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2113 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2114 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2115 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2116 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2117 | 1 \ |
| 2118 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2119 | -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] | 2120 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2121 | -c "X509 - Certificate verification failed" |
| 2122 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2123 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2124 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2125 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2126 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2127 | 0 \ |
| 2128 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2129 | -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] | 2130 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2131 | -C "X509 - Certificate verification failed" |
| 2132 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2133 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2134 | "$P_SRV" \ |
| 2135 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2136 | 0 \ |
| 2137 | -c "x509_verify_cert() returned" \ |
| 2138 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2139 | -c "! Certificate verification flags"\ |
| 2140 | -C "! mbedtls_ssl_handshake returned" \ |
| 2141 | -C "X509 - Certificate verification failed" \ |
| 2142 | -C "SSL - No CA Chain is set, but required to operate" |
| 2143 | |
| 2144 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2145 | "$P_SRV" \ |
| 2146 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2147 | 1 \ |
| 2148 | -c "x509_verify_cert() returned" \ |
| 2149 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2150 | -c "! Certificate verification flags"\ |
| 2151 | -c "! mbedtls_ssl_handshake returned" \ |
| 2152 | -c "SSL - No CA Chain is set, but required to operate" |
| 2153 | |
| 2154 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2155 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2156 | # the client informs the server about the supported curves - it does, though, in the |
| 2157 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2158 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2159 | # different means to have the server ignoring the client's supported curve list. |
| 2160 | |
| 2161 | requires_config_enabled MBEDTLS_ECP_C |
| 2162 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2163 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2164 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2165 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2166 | 1 \ |
| 2167 | -c "bad certificate (EC key curve)"\ |
| 2168 | -c "! Certificate verification flags"\ |
| 2169 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2170 | |
| 2171 | requires_config_enabled MBEDTLS_ECP_C |
| 2172 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2173 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2174 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2175 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2176 | 1 \ |
| 2177 | -c "bad certificate (EC key curve)"\ |
| 2178 | -c "! Certificate verification flags"\ |
| 2179 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2181 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2182 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2183 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2184 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2185 | 0 \ |
| 2186 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2187 | -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] | 2188 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2189 | -C "X509 - Certificate verification failed" |
| 2190 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2191 | run_test "Authentication: client SHA256, server required" \ |
| 2192 | "$P_SRV auth_mode=required" \ |
| 2193 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2194 | key_file=data_files/server6.key \ |
| 2195 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2196 | 0 \ |
| 2197 | -c "Supported Signature Algorithm found: 4," \ |
| 2198 | -c "Supported Signature Algorithm found: 5," |
| 2199 | |
| 2200 | run_test "Authentication: client SHA384, server required" \ |
| 2201 | "$P_SRV auth_mode=required" \ |
| 2202 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2203 | key_file=data_files/server6.key \ |
| 2204 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2205 | 0 \ |
| 2206 | -c "Supported Signature Algorithm found: 4," \ |
| 2207 | -c "Supported Signature Algorithm found: 5," |
| 2208 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2210 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2211 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2212 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2213 | key_file=data_files/server5.key" \ |
| 2214 | 1 \ |
| 2215 | -S "skip write certificate request" \ |
| 2216 | -C "skip parse certificate request" \ |
| 2217 | -c "got a certificate request" \ |
| 2218 | -c "got no certificate to send" \ |
| 2219 | -S "x509_verify_cert() returned" \ |
| 2220 | -s "client has no certificate" \ |
| 2221 | -s "! mbedtls_ssl_handshake returned" \ |
| 2222 | -c "! mbedtls_ssl_handshake returned" \ |
| 2223 | -s "No client certification received from the client, but required by the authentication mode" |
| 2224 | |
| 2225 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2226 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2227 | "$P_CLI debug_level=3 crt_file=none \ |
| 2228 | key_file=data_files/server5.key" \ |
| 2229 | 1 \ |
| 2230 | -S "skip write certificate request" \ |
| 2231 | -C "skip parse certificate request" \ |
| 2232 | -c "got a certificate request" \ |
| 2233 | -c "= write certificate$" \ |
| 2234 | -C "skip write certificate$" \ |
| 2235 | -S "x509_verify_cert() returned" \ |
| 2236 | -s "client has no certificate" \ |
| 2237 | -s "! mbedtls_ssl_handshake returned" \ |
| 2238 | -c "! mbedtls_ssl_handshake returned" \ |
| 2239 | -s "No client certification received from the client, but required by the authentication mode" |
| 2240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2241 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2242 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2243 | "$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] | 2244 | key_file=data_files/server5.key" \ |
| 2245 | 1 \ |
| 2246 | -S "skip write certificate request" \ |
| 2247 | -C "skip parse certificate request" \ |
| 2248 | -c "got a certificate request" \ |
| 2249 | -C "skip write certificate" \ |
| 2250 | -C "skip write certificate verify" \ |
| 2251 | -S "skip parse certificate verify" \ |
| 2252 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2253 | -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] | 2254 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2255 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2256 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2257 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2258 | # We don't check that the client receives the alert because it might |
| 2259 | # detect that its write end of the connection is closed and abort |
| 2260 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2261 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2262 | run_test "Authentication: client cert not trusted, server required" \ |
| 2263 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2264 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2265 | key_file=data_files/server5.key" \ |
| 2266 | 1 \ |
| 2267 | -S "skip write certificate request" \ |
| 2268 | -C "skip parse certificate request" \ |
| 2269 | -c "got a certificate request" \ |
| 2270 | -C "skip write certificate" \ |
| 2271 | -C "skip write certificate verify" \ |
| 2272 | -S "skip parse certificate verify" \ |
| 2273 | -s "x509_verify_cert() returned" \ |
| 2274 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2275 | -s "! mbedtls_ssl_handshake returned" \ |
| 2276 | -c "! mbedtls_ssl_handshake returned" \ |
| 2277 | -s "X509 - Certificate verification failed" |
| 2278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2279 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2280 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2281 | "$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] | 2282 | key_file=data_files/server5.key" \ |
| 2283 | 0 \ |
| 2284 | -S "skip write certificate request" \ |
| 2285 | -C "skip parse certificate request" \ |
| 2286 | -c "got a certificate request" \ |
| 2287 | -C "skip write certificate" \ |
| 2288 | -C "skip write certificate verify" \ |
| 2289 | -S "skip parse certificate verify" \ |
| 2290 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2291 | -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] | 2292 | -S "! mbedtls_ssl_handshake returned" \ |
| 2293 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2294 | -S "X509 - Certificate verification failed" |
| 2295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2296 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2297 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2298 | "$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] | 2299 | key_file=data_files/server5.key" \ |
| 2300 | 0 \ |
| 2301 | -s "skip write certificate request" \ |
| 2302 | -C "skip parse certificate request" \ |
| 2303 | -c "got no certificate request" \ |
| 2304 | -c "skip write certificate" \ |
| 2305 | -c "skip write certificate verify" \ |
| 2306 | -s "skip parse certificate verify" \ |
| 2307 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2308 | -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] | 2309 | -S "! mbedtls_ssl_handshake returned" \ |
| 2310 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2311 | -S "X509 - Certificate verification failed" |
| 2312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2313 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2314 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2315 | "$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] | 2316 | 0 \ |
| 2317 | -S "skip write certificate request" \ |
| 2318 | -C "skip parse certificate request" \ |
| 2319 | -c "got a certificate request" \ |
| 2320 | -C "skip write certificate$" \ |
| 2321 | -C "got no certificate to send" \ |
| 2322 | -S "SSLv3 client has no certificate" \ |
| 2323 | -c "skip write certificate verify" \ |
| 2324 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2325 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2326 | -S "! mbedtls_ssl_handshake returned" \ |
| 2327 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2328 | -S "X509 - Certificate verification failed" |
| 2329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2330 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2331 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2332 | "$O_CLI" \ |
| 2333 | 0 \ |
| 2334 | -S "skip write certificate request" \ |
| 2335 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2336 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2337 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2338 | -S "X509 - Certificate verification failed" |
| 2339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2340 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2341 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2342 | "$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] | 2343 | 0 \ |
| 2344 | -C "skip parse certificate request" \ |
| 2345 | -c "got a certificate request" \ |
| 2346 | -C "skip write certificate$" \ |
| 2347 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2348 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2349 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2350 | run_test "Authentication: client no cert, openssl server required" \ |
| 2351 | "$O_SRV -Verify 10" \ |
| 2352 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2353 | 1 \ |
| 2354 | -C "skip parse certificate request" \ |
| 2355 | -c "got a certificate request" \ |
| 2356 | -C "skip write certificate$" \ |
| 2357 | -c "skip write certificate verify" \ |
| 2358 | -c "! mbedtls_ssl_handshake returned" |
| 2359 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2360 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2361 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2362 | "$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] | 2363 | "$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] | 2364 | 0 \ |
| 2365 | -S "skip write certificate request" \ |
| 2366 | -C "skip parse certificate request" \ |
| 2367 | -c "got a certificate request" \ |
| 2368 | -C "skip write certificate$" \ |
| 2369 | -c "skip write certificate verify" \ |
| 2370 | -c "got no certificate to send" \ |
| 2371 | -s "SSLv3 client has no certificate" \ |
| 2372 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2373 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2374 | -S "! mbedtls_ssl_handshake returned" \ |
| 2375 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2376 | -S "X509 - Certificate verification failed" |
| 2377 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2378 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2379 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2380 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2381 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2382 | 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] | 2383 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2384 | 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] | 2385 | 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] | 2386 | 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] | 2387 | printf "test value of ${MAX_IM_CA}. \n" |
| 2388 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2389 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2390 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2391 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2392 | |
| 2393 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2394 | fi |
| 2395 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2396 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2397 | run_test "Authentication: server max_int chain, client default" \ |
| 2398 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2399 | key_file=data_files/dir-maxpath/09.key" \ |
| 2400 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2401 | 0 \ |
| 2402 | -C "X509 - A fatal error occured" |
| 2403 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2404 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2405 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2406 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2407 | key_file=data_files/dir-maxpath/10.key" \ |
| 2408 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2409 | 1 \ |
| 2410 | -c "X509 - A fatal error occured" |
| 2411 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2412 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2413 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2414 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2415 | key_file=data_files/dir-maxpath/10.key" \ |
| 2416 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2417 | auth_mode=optional" \ |
| 2418 | 1 \ |
| 2419 | -c "X509 - A fatal error occured" |
| 2420 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2421 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2422 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2423 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2424 | key_file=data_files/dir-maxpath/10.key" \ |
| 2425 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2426 | auth_mode=none" \ |
| 2427 | 0 \ |
| 2428 | -C "X509 - A fatal error occured" |
| 2429 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2430 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2431 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2432 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2433 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2434 | key_file=data_files/dir-maxpath/10.key" \ |
| 2435 | 0 \ |
| 2436 | -S "X509 - A fatal error occured" |
| 2437 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2438 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2439 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2440 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2441 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2442 | key_file=data_files/dir-maxpath/10.key" \ |
| 2443 | 1 \ |
| 2444 | -s "X509 - A fatal error occured" |
| 2445 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2446 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2447 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2448 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2449 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2450 | key_file=data_files/dir-maxpath/10.key" \ |
| 2451 | 1 \ |
| 2452 | -s "X509 - A fatal error occured" |
| 2453 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 2454 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2455 | run_test "Authentication: client max_int chain, server required" \ |
| 2456 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2457 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2458 | key_file=data_files/dir-maxpath/09.key" \ |
| 2459 | 0 \ |
| 2460 | -S "X509 - A fatal error occured" |
| 2461 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2462 | # Tests for CA list in CertificateRequest messages |
| 2463 | |
| 2464 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2465 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2466 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2467 | key_file=data_files/server6.key" \ |
| 2468 | 0 \ |
| 2469 | -s "requested DN" |
| 2470 | |
| 2471 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2472 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2473 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2474 | key_file=data_files/server6.key" \ |
| 2475 | 0 \ |
| 2476 | -S "requested DN" |
| 2477 | |
| 2478 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2479 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2480 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2481 | key_file=data_files/server5.key" \ |
| 2482 | 1 \ |
| 2483 | -S "requested DN" \ |
| 2484 | -s "x509_verify_cert() returned" \ |
| 2485 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2486 | -s "! mbedtls_ssl_handshake returned" \ |
| 2487 | -c "! mbedtls_ssl_handshake returned" \ |
| 2488 | -s "X509 - Certificate verification failed" |
| 2489 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2490 | # Tests for certificate selection based on SHA verson |
| 2491 | |
| 2492 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2493 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2494 | key_file=data_files/server5.key \ |
| 2495 | crt_file2=data_files/server5-sha1.crt \ |
| 2496 | key_file2=data_files/server5.key" \ |
| 2497 | "$P_CLI force_version=tls1_2" \ |
| 2498 | 0 \ |
| 2499 | -c "signed using.*ECDSA with SHA256" \ |
| 2500 | -C "signed using.*ECDSA with SHA1" |
| 2501 | |
| 2502 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2503 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2504 | key_file=data_files/server5.key \ |
| 2505 | crt_file2=data_files/server5-sha1.crt \ |
| 2506 | key_file2=data_files/server5.key" \ |
| 2507 | "$P_CLI force_version=tls1_1" \ |
| 2508 | 0 \ |
| 2509 | -C "signed using.*ECDSA with SHA256" \ |
| 2510 | -c "signed using.*ECDSA with SHA1" |
| 2511 | |
| 2512 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2513 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2514 | key_file=data_files/server5.key \ |
| 2515 | crt_file2=data_files/server5-sha1.crt \ |
| 2516 | key_file2=data_files/server5.key" \ |
| 2517 | "$P_CLI force_version=tls1" \ |
| 2518 | 0 \ |
| 2519 | -C "signed using.*ECDSA with SHA256" \ |
| 2520 | -c "signed using.*ECDSA with SHA1" |
| 2521 | |
| 2522 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2523 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2524 | key_file=data_files/server5.key \ |
| 2525 | crt_file2=data_files/server6.crt \ |
| 2526 | key_file2=data_files/server6.key" \ |
| 2527 | "$P_CLI force_version=tls1_1" \ |
| 2528 | 0 \ |
| 2529 | -c "serial number.*09" \ |
| 2530 | -c "signed using.*ECDSA with SHA256" \ |
| 2531 | -C "signed using.*ECDSA with SHA1" |
| 2532 | |
| 2533 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2534 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2535 | key_file=data_files/server6.key \ |
| 2536 | crt_file2=data_files/server5.crt \ |
| 2537 | key_file2=data_files/server5.key" \ |
| 2538 | "$P_CLI force_version=tls1_1" \ |
| 2539 | 0 \ |
| 2540 | -c "serial number.*0A" \ |
| 2541 | -c "signed using.*ECDSA with SHA256" \ |
| 2542 | -C "signed using.*ECDSA with SHA1" |
| 2543 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2544 | # tests for SNI |
| 2545 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2546 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2547 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2548 | 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] | 2549 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2550 | 0 \ |
| 2551 | -S "parse ServerName extension" \ |
| 2552 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2553 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2554 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2555 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2556 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2557 | 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] | 2558 | 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] | 2559 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2560 | 0 \ |
| 2561 | -s "parse ServerName extension" \ |
| 2562 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2563 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2564 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2565 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2566 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2567 | 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] | 2568 | 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] | 2569 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2570 | 0 \ |
| 2571 | -s "parse ServerName extension" \ |
| 2572 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2573 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2574 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2575 | run_test "SNI: no matching cert" \ |
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 | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 2578 | 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] | 2579 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2580 | 1 \ |
| 2581 | -s "parse ServerName extension" \ |
| 2582 | -s "ssl_sni_wrapper() returned" \ |
| 2583 | -s "mbedtls_ssl_handshake returned" \ |
| 2584 | -c "mbedtls_ssl_handshake returned" \ |
| 2585 | -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] | 2586 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2587 | run_test "SNI: client auth no override: optional" \ |
| 2588 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2589 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2590 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2591 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2592 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2593 | -S "skip write certificate request" \ |
| 2594 | -C "skip parse certificate request" \ |
| 2595 | -c "got a certificate request" \ |
| 2596 | -C "skip write certificate" \ |
| 2597 | -C "skip write certificate verify" \ |
| 2598 | -S "skip parse certificate verify" |
| 2599 | |
| 2600 | run_test "SNI: client auth override: none -> optional" \ |
| 2601 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2602 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2603 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2604 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2605 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2606 | -S "skip write certificate request" \ |
| 2607 | -C "skip parse certificate request" \ |
| 2608 | -c "got a certificate request" \ |
| 2609 | -C "skip write certificate" \ |
| 2610 | -C "skip write certificate verify" \ |
| 2611 | -S "skip parse certificate verify" |
| 2612 | |
| 2613 | run_test "SNI: client auth override: optional -> none" \ |
| 2614 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2615 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2616 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2617 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2618 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2619 | -s "skip write certificate request" \ |
| 2620 | -C "skip parse certificate request" \ |
| 2621 | -c "got no certificate request" \ |
| 2622 | -c "skip write certificate" \ |
| 2623 | -c "skip write certificate verify" \ |
| 2624 | -s "skip parse certificate verify" |
| 2625 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2626 | run_test "SNI: CA no override" \ |
| 2627 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2628 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2629 | ca_file=data_files/test-ca.crt \ |
| 2630 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2631 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2632 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2633 | 1 \ |
| 2634 | -S "skip write certificate request" \ |
| 2635 | -C "skip parse certificate request" \ |
| 2636 | -c "got a certificate request" \ |
| 2637 | -C "skip write certificate" \ |
| 2638 | -C "skip write certificate verify" \ |
| 2639 | -S "skip parse certificate verify" \ |
| 2640 | -s "x509_verify_cert() returned" \ |
| 2641 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2642 | -S "The certificate has been revoked (is on a CRL)" |
| 2643 | |
| 2644 | run_test "SNI: CA override" \ |
| 2645 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2646 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2647 | ca_file=data_files/test-ca.crt \ |
| 2648 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2649 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2650 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2651 | 0 \ |
| 2652 | -S "skip write certificate request" \ |
| 2653 | -C "skip parse certificate request" \ |
| 2654 | -c "got a certificate request" \ |
| 2655 | -C "skip write certificate" \ |
| 2656 | -C "skip write certificate verify" \ |
| 2657 | -S "skip parse certificate verify" \ |
| 2658 | -S "x509_verify_cert() returned" \ |
| 2659 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2660 | -S "The certificate has been revoked (is on a CRL)" |
| 2661 | |
| 2662 | run_test "SNI: CA override with CRL" \ |
| 2663 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2664 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2665 | ca_file=data_files/test-ca.crt \ |
| 2666 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2667 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2668 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2669 | 1 \ |
| 2670 | -S "skip write certificate request" \ |
| 2671 | -C "skip parse certificate request" \ |
| 2672 | -c "got a certificate request" \ |
| 2673 | -C "skip write certificate" \ |
| 2674 | -C "skip write certificate verify" \ |
| 2675 | -S "skip parse certificate verify" \ |
| 2676 | -s "x509_verify_cert() returned" \ |
| 2677 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2678 | -s "The certificate has been revoked (is on a CRL)" |
| 2679 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2680 | # Tests for SNI and DTLS |
| 2681 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2682 | run_test "SNI: DTLS, no SNI callback" \ |
| 2683 | "$P_SRV debug_level=3 dtls=1 \ |
| 2684 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2685 | "$P_CLI server_name=localhost dtls=1" \ |
| 2686 | 0 \ |
| 2687 | -S "parse ServerName extension" \ |
| 2688 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2689 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2690 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2691 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2692 | "$P_SRV debug_level=3 dtls=1 \ |
| 2693 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2694 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2695 | "$P_CLI server_name=localhost dtls=1" \ |
| 2696 | 0 \ |
| 2697 | -s "parse ServerName extension" \ |
| 2698 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2699 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2700 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2701 | run_test "SNI: DTLS, matching cert 2" \ |
| 2702 | "$P_SRV debug_level=3 dtls=1 \ |
| 2703 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2704 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2705 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2706 | 0 \ |
| 2707 | -s "parse ServerName extension" \ |
| 2708 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2709 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2710 | |
| 2711 | run_test "SNI: DTLS, no matching cert" \ |
| 2712 | "$P_SRV debug_level=3 dtls=1 \ |
| 2713 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2714 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2715 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2716 | 1 \ |
| 2717 | -s "parse ServerName extension" \ |
| 2718 | -s "ssl_sni_wrapper() returned" \ |
| 2719 | -s "mbedtls_ssl_handshake returned" \ |
| 2720 | -c "mbedtls_ssl_handshake returned" \ |
| 2721 | -c "SSL - A fatal alert message was received from our peer" |
| 2722 | |
| 2723 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2724 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2725 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2726 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2727 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2728 | 0 \ |
| 2729 | -S "skip write certificate request" \ |
| 2730 | -C "skip parse certificate request" \ |
| 2731 | -c "got a certificate request" \ |
| 2732 | -C "skip write certificate" \ |
| 2733 | -C "skip write certificate verify" \ |
| 2734 | -S "skip parse certificate verify" |
| 2735 | |
| 2736 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2737 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2738 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2739 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2740 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2741 | 0 \ |
| 2742 | -S "skip write certificate request" \ |
| 2743 | -C "skip parse certificate request" \ |
| 2744 | -c "got a certificate request" \ |
| 2745 | -C "skip write certificate" \ |
| 2746 | -C "skip write certificate verify" \ |
| 2747 | -S "skip parse certificate verify" |
| 2748 | |
| 2749 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2750 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2751 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2752 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2753 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2754 | 0 \ |
| 2755 | -s "skip write certificate request" \ |
| 2756 | -C "skip parse certificate request" \ |
| 2757 | -c "got no certificate request" \ |
| 2758 | -c "skip write certificate" \ |
| 2759 | -c "skip write certificate verify" \ |
| 2760 | -s "skip parse certificate verify" |
| 2761 | |
| 2762 | run_test "SNI: DTLS, CA no override" \ |
| 2763 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2764 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2765 | ca_file=data_files/test-ca.crt \ |
| 2766 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2767 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2768 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2769 | 1 \ |
| 2770 | -S "skip write certificate request" \ |
| 2771 | -C "skip parse certificate request" \ |
| 2772 | -c "got a certificate request" \ |
| 2773 | -C "skip write certificate" \ |
| 2774 | -C "skip write certificate verify" \ |
| 2775 | -S "skip parse certificate verify" \ |
| 2776 | -s "x509_verify_cert() returned" \ |
| 2777 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2778 | -S "The certificate has been revoked (is on a CRL)" |
| 2779 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2780 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2781 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2782 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2783 | ca_file=data_files/test-ca.crt \ |
| 2784 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2785 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2786 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2787 | 0 \ |
| 2788 | -S "skip write certificate request" \ |
| 2789 | -C "skip parse certificate request" \ |
| 2790 | -c "got a certificate request" \ |
| 2791 | -C "skip write certificate" \ |
| 2792 | -C "skip write certificate verify" \ |
| 2793 | -S "skip parse certificate verify" \ |
| 2794 | -S "x509_verify_cert() returned" \ |
| 2795 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2796 | -S "The certificate has been revoked (is on a CRL)" |
| 2797 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2798 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2799 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2800 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2801 | ca_file=data_files/test-ca.crt \ |
| 2802 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2803 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2804 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2805 | 1 \ |
| 2806 | -S "skip write certificate request" \ |
| 2807 | -C "skip parse certificate request" \ |
| 2808 | -c "got a certificate request" \ |
| 2809 | -C "skip write certificate" \ |
| 2810 | -C "skip write certificate verify" \ |
| 2811 | -S "skip parse certificate verify" \ |
| 2812 | -s "x509_verify_cert() returned" \ |
| 2813 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2814 | -s "The certificate has been revoked (is on a CRL)" |
| 2815 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2816 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2817 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2818 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2819 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2820 | "$P_CLI nbio=2 tickets=0" \ |
| 2821 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2822 | -S "mbedtls_ssl_handshake returned" \ |
| 2823 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2824 | -c "Read from server: .* bytes read" |
| 2825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2826 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2827 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2828 | "$P_CLI nbio=2 tickets=0" \ |
| 2829 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2830 | -S "mbedtls_ssl_handshake returned" \ |
| 2831 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2832 | -c "Read from server: .* bytes read" |
| 2833 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2834 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2835 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2836 | "$P_CLI nbio=2 tickets=1" \ |
| 2837 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2838 | -S "mbedtls_ssl_handshake returned" \ |
| 2839 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2840 | -c "Read from server: .* bytes read" |
| 2841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2842 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2843 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2844 | "$P_CLI nbio=2 tickets=1" \ |
| 2845 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2846 | -S "mbedtls_ssl_handshake returned" \ |
| 2847 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2848 | -c "Read from server: .* bytes read" |
| 2849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2850 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2851 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2852 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2853 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2854 | -S "mbedtls_ssl_handshake returned" \ |
| 2855 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2856 | -c "Read from server: .* bytes read" |
| 2857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2858 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2859 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2860 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2861 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2862 | -S "mbedtls_ssl_handshake returned" \ |
| 2863 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2864 | -c "Read from server: .* bytes read" |
| 2865 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2866 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2867 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2868 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 2869 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2870 | -S "mbedtls_ssl_handshake returned" \ |
| 2871 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2872 | -c "Read from server: .* bytes read" |
| 2873 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 2874 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 2875 | |
| 2876 | run_test "Event-driven I/O: basic handshake" \ |
| 2877 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2878 | "$P_CLI event=1 tickets=0" \ |
| 2879 | 0 \ |
| 2880 | -S "mbedtls_ssl_handshake returned" \ |
| 2881 | -C "mbedtls_ssl_handshake returned" \ |
| 2882 | -c "Read from server: .* bytes read" |
| 2883 | |
| 2884 | run_test "Event-driven I/O: client auth" \ |
| 2885 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 2886 | "$P_CLI event=1 tickets=0" \ |
| 2887 | 0 \ |
| 2888 | -S "mbedtls_ssl_handshake returned" \ |
| 2889 | -C "mbedtls_ssl_handshake returned" \ |
| 2890 | -c "Read from server: .* bytes read" |
| 2891 | |
| 2892 | run_test "Event-driven I/O: ticket" \ |
| 2893 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2894 | "$P_CLI event=1 tickets=1" \ |
| 2895 | 0 \ |
| 2896 | -S "mbedtls_ssl_handshake returned" \ |
| 2897 | -C "mbedtls_ssl_handshake returned" \ |
| 2898 | -c "Read from server: .* bytes read" |
| 2899 | |
| 2900 | run_test "Event-driven I/O: ticket + client auth" \ |
| 2901 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2902 | "$P_CLI event=1 tickets=1" \ |
| 2903 | 0 \ |
| 2904 | -S "mbedtls_ssl_handshake returned" \ |
| 2905 | -C "mbedtls_ssl_handshake returned" \ |
| 2906 | -c "Read from server: .* bytes read" |
| 2907 | |
| 2908 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 2909 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 2910 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2911 | 0 \ |
| 2912 | -S "mbedtls_ssl_handshake returned" \ |
| 2913 | -C "mbedtls_ssl_handshake returned" \ |
| 2914 | -c "Read from server: .* bytes read" |
| 2915 | |
| 2916 | run_test "Event-driven I/O: ticket + resume" \ |
| 2917 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 2918 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 2919 | 0 \ |
| 2920 | -S "mbedtls_ssl_handshake returned" \ |
| 2921 | -C "mbedtls_ssl_handshake returned" \ |
| 2922 | -c "Read from server: .* bytes read" |
| 2923 | |
| 2924 | run_test "Event-driven I/O: session-id resume" \ |
| 2925 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 2926 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 2927 | 0 \ |
| 2928 | -S "mbedtls_ssl_handshake returned" \ |
| 2929 | -C "mbedtls_ssl_handshake returned" \ |
| 2930 | -c "Read from server: .* bytes read" |
| 2931 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 2932 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 2933 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2934 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2935 | 0 \ |
| 2936 | -c "Read from server: .* bytes read" |
| 2937 | |
| 2938 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 2939 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 2940 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 2941 | 0 \ |
| 2942 | -c "Read from server: .* bytes read" |
| 2943 | |
| 2944 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 2945 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2946 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2947 | 0 \ |
| 2948 | -c "Read from server: .* bytes read" |
| 2949 | |
| 2950 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 2951 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2952 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 2953 | 0 \ |
| 2954 | -c "Read from server: .* bytes read" |
| 2955 | |
| 2956 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 2957 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 2958 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2959 | 0 \ |
| 2960 | -c "Read from server: .* bytes read" |
| 2961 | |
| 2962 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 2963 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 2964 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 2965 | 0 \ |
| 2966 | -c "Read from server: .* bytes read" |
| 2967 | |
| 2968 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 2969 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 2970 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 2971 | 0 \ |
| 2972 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 2973 | |
| 2974 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 2975 | # During session resumption, the client will send its ApplicationData record |
| 2976 | # within the same datagram as the Finished messages. In this situation, the |
| 2977 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 2978 | # because the ApplicationData request has already been queued internally. |
| 2979 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 2980 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 2981 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 2982 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 2983 | 0 \ |
| 2984 | -c "Read from server: .* bytes read" |
| 2985 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2986 | # Tests for version negotiation |
| 2987 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2988 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2989 | "$P_SRV" \ |
| 2990 | "$P_CLI" \ |
| 2991 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2992 | -S "mbedtls_ssl_handshake returned" \ |
| 2993 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2994 | -s "Protocol is TLSv1.2" \ |
| 2995 | -c "Protocol is TLSv1.2" |
| 2996 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2997 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2998 | "$P_SRV" \ |
| 2999 | "$P_CLI max_version=tls1_1" \ |
| 3000 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3001 | -S "mbedtls_ssl_handshake returned" \ |
| 3002 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3003 | -s "Protocol is TLSv1.1" \ |
| 3004 | -c "Protocol is TLSv1.1" |
| 3005 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3006 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3007 | "$P_SRV max_version=tls1_1" \ |
| 3008 | "$P_CLI" \ |
| 3009 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3010 | -S "mbedtls_ssl_handshake returned" \ |
| 3011 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3012 | -s "Protocol is TLSv1.1" \ |
| 3013 | -c "Protocol is TLSv1.1" |
| 3014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3015 | 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] | 3016 | "$P_SRV max_version=tls1_1" \ |
| 3017 | "$P_CLI max_version=tls1_1" \ |
| 3018 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3019 | -S "mbedtls_ssl_handshake returned" \ |
| 3020 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3021 | -s "Protocol is TLSv1.1" \ |
| 3022 | -c "Protocol is TLSv1.1" |
| 3023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3024 | 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] | 3025 | "$P_SRV min_version=tls1_1" \ |
| 3026 | "$P_CLI max_version=tls1_1" \ |
| 3027 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3028 | -S "mbedtls_ssl_handshake returned" \ |
| 3029 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3030 | -s "Protocol is TLSv1.1" \ |
| 3031 | -c "Protocol is TLSv1.1" |
| 3032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3033 | 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] | 3034 | "$P_SRV max_version=tls1_1" \ |
| 3035 | "$P_CLI min_version=tls1_1" \ |
| 3036 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3037 | -S "mbedtls_ssl_handshake returned" \ |
| 3038 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3039 | -s "Protocol is TLSv1.1" \ |
| 3040 | -c "Protocol is TLSv1.1" |
| 3041 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3042 | 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] | 3043 | "$P_SRV max_version=tls1_1" \ |
| 3044 | "$P_CLI min_version=tls1_2" \ |
| 3045 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3046 | -s "mbedtls_ssl_handshake returned" \ |
| 3047 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3048 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3050 | 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] | 3051 | "$P_SRV min_version=tls1_2" \ |
| 3052 | "$P_CLI max_version=tls1_1" \ |
| 3053 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3054 | -s "mbedtls_ssl_handshake returned" \ |
| 3055 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3056 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3057 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3058 | # Tests for ALPN extension |
| 3059 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3060 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3061 | "$P_SRV debug_level=3" \ |
| 3062 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3063 | 0 \ |
| 3064 | -C "client hello, adding alpn extension" \ |
| 3065 | -S "found alpn extension" \ |
| 3066 | -C "got an alert message, type: \\[2:120]" \ |
| 3067 | -S "server hello, adding alpn extension" \ |
| 3068 | -C "found alpn extension " \ |
| 3069 | -C "Application Layer Protocol is" \ |
| 3070 | -S "Application Layer Protocol is" |
| 3071 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3072 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3073 | "$P_SRV debug_level=3" \ |
| 3074 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3075 | 0 \ |
| 3076 | -c "client hello, adding alpn extension" \ |
| 3077 | -s "found alpn extension" \ |
| 3078 | -C "got an alert message, type: \\[2:120]" \ |
| 3079 | -S "server hello, adding alpn extension" \ |
| 3080 | -C "found alpn extension " \ |
| 3081 | -c "Application Layer Protocol is (none)" \ |
| 3082 | -S "Application Layer Protocol is" |
| 3083 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3084 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3085 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3086 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3087 | 0 \ |
| 3088 | -C "client hello, adding alpn extension" \ |
| 3089 | -S "found alpn extension" \ |
| 3090 | -C "got an alert message, type: \\[2:120]" \ |
| 3091 | -S "server hello, adding alpn extension" \ |
| 3092 | -C "found alpn extension " \ |
| 3093 | -C "Application Layer Protocol is" \ |
| 3094 | -s "Application Layer Protocol is (none)" |
| 3095 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3096 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3097 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3098 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3099 | 0 \ |
| 3100 | -c "client hello, adding alpn extension" \ |
| 3101 | -s "found alpn extension" \ |
| 3102 | -C "got an alert message, type: \\[2:120]" \ |
| 3103 | -s "server hello, adding alpn extension" \ |
| 3104 | -c "found alpn extension" \ |
| 3105 | -c "Application Layer Protocol is abc" \ |
| 3106 | -s "Application Layer Protocol is abc" |
| 3107 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3108 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3109 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3110 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3111 | 0 \ |
| 3112 | -c "client hello, adding alpn extension" \ |
| 3113 | -s "found alpn extension" \ |
| 3114 | -C "got an alert message, type: \\[2:120]" \ |
| 3115 | -s "server hello, adding alpn extension" \ |
| 3116 | -c "found alpn extension" \ |
| 3117 | -c "Application Layer Protocol is abc" \ |
| 3118 | -s "Application Layer Protocol is abc" |
| 3119 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3120 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3121 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3122 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3123 | 0 \ |
| 3124 | -c "client hello, adding alpn extension" \ |
| 3125 | -s "found alpn extension" \ |
| 3126 | -C "got an alert message, type: \\[2:120]" \ |
| 3127 | -s "server hello, adding alpn extension" \ |
| 3128 | -c "found alpn extension" \ |
| 3129 | -c "Application Layer Protocol is 1234" \ |
| 3130 | -s "Application Layer Protocol is 1234" |
| 3131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3132 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3133 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3134 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3135 | 1 \ |
| 3136 | -c "client hello, adding alpn extension" \ |
| 3137 | -s "found alpn extension" \ |
| 3138 | -c "got an alert message, type: \\[2:120]" \ |
| 3139 | -S "server hello, adding alpn extension" \ |
| 3140 | -C "found alpn extension" \ |
| 3141 | -C "Application Layer Protocol is 1234" \ |
| 3142 | -S "Application Layer Protocol is 1234" |
| 3143 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3144 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3145 | # Tests for keyUsage in leaf certificates, part 1: |
| 3146 | # server-side certificate/suite selection |
| 3147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3148 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3149 | "$P_SRV key_file=data_files/server2.key \ |
| 3150 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3151 | "$P_CLI" \ |
| 3152 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3153 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3154 | |
| 3155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3156 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3157 | "$P_SRV key_file=data_files/server2.key \ |
| 3158 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3159 | "$P_CLI" \ |
| 3160 | 0 \ |
| 3161 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3162 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3163 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3164 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3165 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3166 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3167 | 1 \ |
| 3168 | -C "Ciphersuite is " |
| 3169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3170 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3171 | "$P_SRV key_file=data_files/server5.key \ |
| 3172 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3173 | "$P_CLI" \ |
| 3174 | 0 \ |
| 3175 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3176 | |
| 3177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3178 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3179 | "$P_SRV key_file=data_files/server5.key \ |
| 3180 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3181 | "$P_CLI" \ |
| 3182 | 0 \ |
| 3183 | -c "Ciphersuite is TLS-ECDH-" |
| 3184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3185 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3186 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3187 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3188 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3189 | 1 \ |
| 3190 | -C "Ciphersuite is " |
| 3191 | |
| 3192 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3193 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3194 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3195 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3196 | "$O_SRV -key data_files/server2.key \ |
| 3197 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3198 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3199 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3200 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3201 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3202 | -C "Processing of the Certificate handshake message failed" \ |
| 3203 | -c "Ciphersuite is TLS-" |
| 3204 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3205 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3206 | "$O_SRV -key data_files/server2.key \ |
| 3207 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3208 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3209 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3210 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3211 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3212 | -C "Processing of the Certificate handshake message failed" \ |
| 3213 | -c "Ciphersuite is TLS-" |
| 3214 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3215 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3216 | "$O_SRV -key data_files/server2.key \ |
| 3217 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3218 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3219 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3220 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3221 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3222 | -C "Processing of the Certificate handshake message failed" \ |
| 3223 | -c "Ciphersuite is TLS-" |
| 3224 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3225 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3226 | "$O_SRV -key data_files/server2.key \ |
| 3227 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3228 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3229 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3230 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3231 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3232 | -c "Processing of the Certificate handshake message failed" \ |
| 3233 | -C "Ciphersuite is TLS-" |
| 3234 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3235 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3236 | "$O_SRV -key data_files/server2.key \ |
| 3237 | -cert data_files/server2.ku-ke.crt" \ |
| 3238 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3239 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3240 | 0 \ |
| 3241 | -c "bad certificate (usage extensions)" \ |
| 3242 | -C "Processing of the Certificate handshake message failed" \ |
| 3243 | -c "Ciphersuite is TLS-" \ |
| 3244 | -c "! Usage does not match the keyUsage extension" |
| 3245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3246 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3247 | "$O_SRV -key data_files/server2.key \ |
| 3248 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3249 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3250 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3251 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3252 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3253 | -C "Processing of the Certificate handshake message failed" \ |
| 3254 | -c "Ciphersuite is TLS-" |
| 3255 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3256 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3257 | "$O_SRV -key data_files/server2.key \ |
| 3258 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3259 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3260 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3261 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3262 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3263 | -c "Processing of the Certificate handshake message failed" \ |
| 3264 | -C "Ciphersuite is TLS-" |
| 3265 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3266 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3267 | "$O_SRV -key data_files/server2.key \ |
| 3268 | -cert data_files/server2.ku-ds.crt" \ |
| 3269 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3270 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3271 | 0 \ |
| 3272 | -c "bad certificate (usage extensions)" \ |
| 3273 | -C "Processing of the Certificate handshake message failed" \ |
| 3274 | -c "Ciphersuite is TLS-" \ |
| 3275 | -c "! Usage does not match the keyUsage extension" |
| 3276 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3277 | # Tests for keyUsage in leaf certificates, part 3: |
| 3278 | # server-side checking of client cert |
| 3279 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3280 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3281 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3282 | "$O_CLI -key data_files/server2.key \ |
| 3283 | -cert data_files/server2.ku-ds.crt" \ |
| 3284 | 0 \ |
| 3285 | -S "bad certificate (usage extensions)" \ |
| 3286 | -S "Processing of the Certificate handshake message failed" |
| 3287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3288 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3289 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3290 | "$O_CLI -key data_files/server2.key \ |
| 3291 | -cert data_files/server2.ku-ke.crt" \ |
| 3292 | 0 \ |
| 3293 | -s "bad certificate (usage extensions)" \ |
| 3294 | -S "Processing of the Certificate handshake message failed" |
| 3295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3296 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3297 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3298 | "$O_CLI -key data_files/server2.key \ |
| 3299 | -cert data_files/server2.ku-ke.crt" \ |
| 3300 | 1 \ |
| 3301 | -s "bad certificate (usage extensions)" \ |
| 3302 | -s "Processing of the Certificate handshake message failed" |
| 3303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3304 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3305 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3306 | "$O_CLI -key data_files/server5.key \ |
| 3307 | -cert data_files/server5.ku-ds.crt" \ |
| 3308 | 0 \ |
| 3309 | -S "bad certificate (usage extensions)" \ |
| 3310 | -S "Processing of the Certificate handshake message failed" |
| 3311 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3312 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3313 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3314 | "$O_CLI -key data_files/server5.key \ |
| 3315 | -cert data_files/server5.ku-ka.crt" \ |
| 3316 | 0 \ |
| 3317 | -s "bad certificate (usage extensions)" \ |
| 3318 | -S "Processing of the Certificate handshake message failed" |
| 3319 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3320 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3322 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3323 | "$P_SRV key_file=data_files/server5.key \ |
| 3324 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3325 | "$P_CLI" \ |
| 3326 | 0 |
| 3327 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3328 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3329 | "$P_SRV key_file=data_files/server5.key \ |
| 3330 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3331 | "$P_CLI" \ |
| 3332 | 0 |
| 3333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3334 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3335 | "$P_SRV key_file=data_files/server5.key \ |
| 3336 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3337 | "$P_CLI" \ |
| 3338 | 0 |
| 3339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3340 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3341 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3342 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3343 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3344 | 1 |
| 3345 | |
| 3346 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3347 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3348 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3349 | "$O_SRV -key data_files/server5.key \ |
| 3350 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3351 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3352 | 0 \ |
| 3353 | -C "bad certificate (usage extensions)" \ |
| 3354 | -C "Processing of the Certificate handshake message failed" \ |
| 3355 | -c "Ciphersuite is TLS-" |
| 3356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3358 | "$O_SRV -key data_files/server5.key \ |
| 3359 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3360 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3361 | 0 \ |
| 3362 | -C "bad certificate (usage extensions)" \ |
| 3363 | -C "Processing of the Certificate handshake message failed" \ |
| 3364 | -c "Ciphersuite is TLS-" |
| 3365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3366 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3367 | "$O_SRV -key data_files/server5.key \ |
| 3368 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3369 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3370 | 0 \ |
| 3371 | -C "bad certificate (usage extensions)" \ |
| 3372 | -C "Processing of the Certificate handshake message failed" \ |
| 3373 | -c "Ciphersuite is TLS-" |
| 3374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3375 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3376 | "$O_SRV -key data_files/server5.key \ |
| 3377 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3378 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3379 | 1 \ |
| 3380 | -c "bad certificate (usage extensions)" \ |
| 3381 | -c "Processing of the Certificate handshake message failed" \ |
| 3382 | -C "Ciphersuite is TLS-" |
| 3383 | |
| 3384 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3386 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3387 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3388 | "$O_CLI -key data_files/server5.key \ |
| 3389 | -cert data_files/server5.eku-cli.crt" \ |
| 3390 | 0 \ |
| 3391 | -S "bad certificate (usage extensions)" \ |
| 3392 | -S "Processing of the Certificate handshake message failed" |
| 3393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3394 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3395 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3396 | "$O_CLI -key data_files/server5.key \ |
| 3397 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3398 | 0 \ |
| 3399 | -S "bad certificate (usage extensions)" \ |
| 3400 | -S "Processing of the Certificate handshake message failed" |
| 3401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3402 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3403 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3404 | "$O_CLI -key data_files/server5.key \ |
| 3405 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3406 | 0 \ |
| 3407 | -S "bad certificate (usage extensions)" \ |
| 3408 | -S "Processing of the Certificate handshake message failed" |
| 3409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3410 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3411 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3412 | "$O_CLI -key data_files/server5.key \ |
| 3413 | -cert data_files/server5.eku-cs.crt" \ |
| 3414 | 0 \ |
| 3415 | -s "bad certificate (usage extensions)" \ |
| 3416 | -S "Processing of the Certificate handshake message failed" |
| 3417 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3418 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3419 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3420 | "$O_CLI -key data_files/server5.key \ |
| 3421 | -cert data_files/server5.eku-cs.crt" \ |
| 3422 | 1 \ |
| 3423 | -s "bad certificate (usage extensions)" \ |
| 3424 | -s "Processing of the Certificate handshake message failed" |
| 3425 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3426 | # Tests for DHM parameters loading |
| 3427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3428 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3429 | "$P_SRV" \ |
| 3430 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3431 | debug_level=3" \ |
| 3432 | 0 \ |
| 3433 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3434 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3436 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3437 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3438 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3439 | debug_level=3" \ |
| 3440 | 0 \ |
| 3441 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3442 | -c "value of 'DHM: G ' (2 bits)" |
| 3443 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3444 | # Tests for DHM client-side size checking |
| 3445 | |
| 3446 | run_test "DHM size: server default, client default, OK" \ |
| 3447 | "$P_SRV" \ |
| 3448 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3449 | debug_level=1" \ |
| 3450 | 0 \ |
| 3451 | -C "DHM prime too short:" |
| 3452 | |
| 3453 | run_test "DHM size: server default, client 2048, OK" \ |
| 3454 | "$P_SRV" \ |
| 3455 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3456 | debug_level=1 dhmlen=2048" \ |
| 3457 | 0 \ |
| 3458 | -C "DHM prime too short:" |
| 3459 | |
| 3460 | run_test "DHM size: server 1024, client default, OK" \ |
| 3461 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3462 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3463 | debug_level=1" \ |
| 3464 | 0 \ |
| 3465 | -C "DHM prime too short:" |
| 3466 | |
| 3467 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3468 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3469 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3470 | debug_level=1" \ |
| 3471 | 1 \ |
| 3472 | -c "DHM prime too short:" |
| 3473 | |
| 3474 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3475 | "$P_SRV" \ |
| 3476 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3477 | debug_level=1 dhmlen=2049" \ |
| 3478 | 1 \ |
| 3479 | -c "DHM prime too short:" |
| 3480 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3481 | # Tests for PSK callback |
| 3482 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3483 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3484 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3485 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3486 | psk_identity=foo psk=abc123" \ |
| 3487 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3488 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3489 | -S "SSL - Unknown identity received" \ |
| 3490 | -S "SSL - Verification of the message MAC failed" |
| 3491 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3492 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3493 | "$P_SRV" \ |
| 3494 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3495 | psk_identity=foo psk=abc123" \ |
| 3496 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3497 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3498 | -S "SSL - Unknown identity received" \ |
| 3499 | -S "SSL - Verification of the message MAC failed" |
| 3500 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3501 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3502 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3503 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3504 | psk_identity=foo psk=abc123" \ |
| 3505 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3506 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3507 | -s "SSL - Unknown identity received" \ |
| 3508 | -S "SSL - Verification of the message MAC failed" |
| 3509 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3510 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3511 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3512 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3513 | psk_identity=abc psk=dead" \ |
| 3514 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3515 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3516 | -S "SSL - Unknown identity received" \ |
| 3517 | -S "SSL - Verification of the message MAC failed" |
| 3518 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3519 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3520 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3521 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3522 | psk_identity=def psk=beef" \ |
| 3523 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3524 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3525 | -S "SSL - Unknown identity received" \ |
| 3526 | -S "SSL - Verification of the message MAC failed" |
| 3527 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3528 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3529 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3530 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3531 | psk_identity=ghi psk=beef" \ |
| 3532 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3533 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3534 | -s "SSL - Unknown identity received" \ |
| 3535 | -S "SSL - Verification of the message MAC failed" |
| 3536 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3537 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3538 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3539 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3540 | psk_identity=abc psk=beef" \ |
| 3541 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3542 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3543 | -S "SSL - Unknown identity received" \ |
| 3544 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3545 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3546 | # Tests for EC J-PAKE |
| 3547 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3549 | run_test "ECJPAKE: client not configured" \ |
| 3550 | "$P_SRV debug_level=3" \ |
| 3551 | "$P_CLI debug_level=3" \ |
| 3552 | 0 \ |
| 3553 | -C "add ciphersuite: c0ff" \ |
| 3554 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3555 | -S "found ecjpake kkpp extension" \ |
| 3556 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3557 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3558 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3559 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3560 | -S "None of the common ciphersuites is usable" |
| 3561 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3562 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3563 | run_test "ECJPAKE: server not configured" \ |
| 3564 | "$P_SRV debug_level=3" \ |
| 3565 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3566 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3567 | 1 \ |
| 3568 | -c "add ciphersuite: c0ff" \ |
| 3569 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3570 | -s "found ecjpake kkpp extension" \ |
| 3571 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3572 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3573 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3574 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3575 | -s "None of the common ciphersuites is usable" |
| 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 | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3578 | run_test "ECJPAKE: working, TLS" \ |
| 3579 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3580 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3581 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3582 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3583 | -c "add ciphersuite: c0ff" \ |
| 3584 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3585 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3586 | -s "found ecjpake kkpp extension" \ |
| 3587 | -S "skip ecjpake kkpp extension" \ |
| 3588 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3589 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3590 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3591 | -S "None of the common ciphersuites is usable" \ |
| 3592 | -S "SSL - Verification of the message MAC failed" |
| 3593 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3594 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3596 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 3597 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3598 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3599 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3600 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3601 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3602 | -s "SSL - Verification of the message MAC failed" |
| 3603 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3604 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3605 | run_test "ECJPAKE: working, DTLS" \ |
| 3606 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3607 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3608 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3609 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3610 | -c "re-using cached ecjpake parameters" \ |
| 3611 | -S "SSL - Verification of the message MAC failed" |
| 3612 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3614 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3615 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3616 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3617 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3618 | 0 \ |
| 3619 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3620 | -S "SSL - Verification of the message MAC failed" |
| 3621 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3622 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3623 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3624 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 3625 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3626 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 3627 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3628 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3629 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3630 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3631 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3632 | # for tests with configs/config-thread.h |
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 | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3634 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 3635 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 3636 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 3637 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3638 | 0 |
| 3639 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3640 | # Tests for ciphersuites per version |
| 3641 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3642 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3643 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3644 | "$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] | 3645 | "$P_CLI force_version=ssl3" \ |
| 3646 | 0 \ |
| 3647 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3648 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3649 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3650 | "$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] | 3651 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3652 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3653 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3655 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3656 | "$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] | 3657 | "$P_CLI force_version=tls1_1" \ |
| 3658 | 0 \ |
| 3659 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3661 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3662 | "$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] | 3663 | "$P_CLI force_version=tls1_2" \ |
| 3664 | 0 \ |
| 3665 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3666 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3667 | # Test for ClientHello without extensions |
| 3668 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3669 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3670 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3671 | "$P_SRV debug_level=3" \ |
| 3672 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3673 | 0 \ |
| 3674 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3675 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3676 | requires_gnutls |
| 3677 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3678 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
| 3679 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3680 | 0 \ |
| 3681 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3682 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3683 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3684 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3685 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3686 | "$P_SRV" \ |
| 3687 | "$P_CLI request_size=100" \ |
| 3688 | 0 \ |
| 3689 | -s "Read from client: 100 bytes read$" |
| 3690 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3691 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3692 | "$P_SRV" \ |
| 3693 | "$P_CLI request_size=500" \ |
| 3694 | 0 \ |
| 3695 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3696 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3697 | # Tests for small packets |
| 3698 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3700 | run_test "Small packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3701 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3702 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3703 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3704 | 0 \ |
| 3705 | -s "Read from client: 1 bytes read" |
| 3706 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3707 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3708 | run_test "Small packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3709 | "$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] | 3710 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3711 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3712 | 0 \ |
| 3713 | -s "Read from client: 1 bytes read" |
| 3714 | |
| 3715 | run_test "Small packet TLS 1.0 BlockCipher" \ |
| 3716 | "$P_SRV" \ |
| 3717 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3718 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3719 | 0 \ |
| 3720 | -s "Read from client: 1 bytes read" |
| 3721 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3722 | run_test "Small packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3723 | "$P_SRV" \ |
| 3724 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3726 | 0 \ |
| 3727 | -s "Read from client: 1 bytes read" |
| 3728 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3729 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3730 | run_test "Small packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3731 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3732 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3733 | 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] | 3734 | 0 \ |
| 3735 | -s "Read from client: 1 bytes read" |
| 3736 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3737 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3738 | run_test "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3739 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3740 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3741 | 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] | 3742 | 0 \ |
| 3743 | -s "Read from client: 1 bytes read" |
| 3744 | |
| 3745 | run_test "Small packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3746 | "$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] | 3747 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3748 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3749 | 0 \ |
| 3750 | -s "Read from client: 1 bytes read" |
| 3751 | |
| 3752 | run_test "Small packet TLS 1.0 StreamCipher, without EtM" \ |
| 3753 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3754 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3755 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3756 | 0 \ |
| 3757 | -s "Read from client: 1 bytes read" |
| 3758 | |
| 3759 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3760 | run_test "Small packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3761 | "$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] | 3762 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3763 | 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] | 3764 | 0 \ |
| 3765 | -s "Read from client: 1 bytes read" |
| 3766 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3767 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3768 | run_test "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3769 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3770 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3771 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3772 | 0 \ |
| 3773 | -s "Read from client: 1 bytes read" |
| 3774 | |
| 3775 | run_test "Small packet TLS 1.1 BlockCipher" \ |
| 3776 | "$P_SRV" \ |
| 3777 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3779 | 0 \ |
| 3780 | -s "Read from client: 1 bytes read" |
| 3781 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3782 | run_test "Small packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3783 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3784 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3785 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3786 | 0 \ |
| 3787 | -s "Read from client: 1 bytes read" |
| 3788 | |
| 3789 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3790 | run_test "Small packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3791 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3792 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3793 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3794 | 0 \ |
| 3795 | -s "Read from client: 1 bytes read" |
| 3796 | |
| 3797 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3798 | run_test "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3799 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3800 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3801 | 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] | 3802 | 0 \ |
| 3803 | -s "Read from client: 1 bytes read" |
| 3804 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3805 | run_test "Small packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3806 | "$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] | 3807 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3808 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3809 | 0 \ |
| 3810 | -s "Read from client: 1 bytes read" |
| 3811 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3812 | run_test "Small packet TLS 1.1 StreamCipher, without EtM" \ |
| 3813 | "$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] | 3814 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3815 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3816 | 0 \ |
| 3817 | -s "Read from client: 1 bytes read" |
| 3818 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3819 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3820 | run_test "Small packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3821 | "$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] | 3822 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3823 | 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] | 3824 | 0 \ |
| 3825 | -s "Read from client: 1 bytes read" |
| 3826 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3827 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3828 | run_test "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3829 | "$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] | 3830 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3831 | 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] | 3832 | 0 \ |
| 3833 | -s "Read from client: 1 bytes read" |
| 3834 | |
| 3835 | run_test "Small packet TLS 1.2 BlockCipher" \ |
| 3836 | "$P_SRV" \ |
| 3837 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3838 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3839 | 0 \ |
| 3840 | -s "Read from client: 1 bytes read" |
| 3841 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3842 | run_test "Small packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3843 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3844 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3845 | 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] | 3846 | 0 \ |
| 3847 | -s "Read from client: 1 bytes read" |
| 3848 | |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3849 | run_test "Small packet TLS 1.2 BlockCipher larger MAC" \ |
| 3850 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3851 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3852 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
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.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3858 | "$P_SRV 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_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3860 | 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] | 3861 | 0 \ |
| 3862 | -s "Read from client: 1 bytes read" |
| 3863 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3864 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3865 | run_test "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3866 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3867 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3868 | 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] | 3869 | 0 \ |
| 3870 | -s "Read from client: 1 bytes read" |
| 3871 | |
| 3872 | run_test "Small packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3873 | "$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] | 3874 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3875 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3876 | 0 \ |
| 3877 | -s "Read from client: 1 bytes read" |
| 3878 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3879 | run_test "Small packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3880 | "$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] | 3881 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3882 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -s "Read from client: 1 bytes read" |
| 3885 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3886 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3887 | run_test "Small packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3888 | "$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] | 3889 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3890 | 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] | 3891 | 0 \ |
| 3892 | -s "Read from client: 1 bytes read" |
| 3893 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3894 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3895 | run_test "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3896 | "$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] | 3897 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3898 | 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] | 3899 | 0 \ |
| 3900 | -s "Read from client: 1 bytes read" |
| 3901 | |
| 3902 | run_test "Small packet TLS 1.2 AEAD" \ |
| 3903 | "$P_SRV" \ |
| 3904 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3906 | 0 \ |
| 3907 | -s "Read from client: 1 bytes read" |
| 3908 | |
| 3909 | run_test "Small packet TLS 1.2 AEAD shorter tag" \ |
| 3910 | "$P_SRV" \ |
| 3911 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3912 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3913 | 0 \ |
| 3914 | -s "Read from client: 1 bytes read" |
| 3915 | |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3916 | # Tests for small packets in DTLS |
| 3917 | |
| 3918 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3919 | run_test "Small packet DTLS 1.0" \ |
| 3920 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 3921 | "$P_CLI dtls=1 request_size=1 \ |
| 3922 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3923 | 0 \ |
| 3924 | -s "Read from client: 1 bytes read" |
| 3925 | |
| 3926 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3927 | run_test "Small packet DTLS 1.0, without EtM" \ |
| 3928 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 3929 | "$P_CLI dtls=1 request_size=1 \ |
| 3930 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3931 | 0 \ |
| 3932 | -s "Read from client: 1 bytes read" |
| 3933 | |
| 3934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3935 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3936 | run_test "Small packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3937 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 3938 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3939 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3940 | 0 \ |
| 3941 | -s "Read from client: 1 bytes read" |
| 3942 | |
| 3943 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3944 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3945 | run_test "Small packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3946 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3947 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3948 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3949 | 0 \ |
| 3950 | -s "Read from client: 1 bytes read" |
| 3951 | |
| 3952 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3953 | run_test "Small packet DTLS 1.2" \ |
| 3954 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 3955 | "$P_CLI dtls=1 request_size=1 \ |
| 3956 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3957 | 0 \ |
| 3958 | -s "Read from client: 1 bytes read" |
| 3959 | |
| 3960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3961 | run_test "Small packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3962 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3963 | "$P_CLI dtls=1 request_size=1 \ |
| 3964 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3965 | 0 \ |
| 3966 | -s "Read from client: 1 bytes read" |
| 3967 | |
| 3968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3969 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3970 | run_test "Small packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3971 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3972 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3973 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3974 | 0 \ |
| 3975 | -s "Read from client: 1 bytes read" |
| 3976 | |
| 3977 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3978 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3979 | run_test "Small packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3980 | "$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] | 3981 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3982 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3983 | 0 \ |
| 3984 | -s "Read from client: 1 bytes read" |
| 3985 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 3986 | # A test for extensions in SSLv3 |
| 3987 | |
| 3988 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3989 | run_test "SSLv3 with extensions, server side" \ |
| 3990 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 3991 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 3992 | 0 \ |
| 3993 | -S "dumping 'client hello extensions'" \ |
| 3994 | -S "server hello, total extension length:" |
| 3995 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3996 | # Test for large packets |
| 3997 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 3998 | # How many fragments do we expect to write $1 bytes? |
| 3999 | fragments_for_write() { |
| 4000 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4001 | } |
| 4002 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4003 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4004 | run_test "Large packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4005 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4006 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4007 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4008 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4009 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4010 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4011 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4012 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4013 | run_test "Large packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4014 | "$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] | 4015 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4016 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4017 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4018 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4019 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4020 | |
| 4021 | run_test "Large packet TLS 1.0 BlockCipher" \ |
| 4022 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4023 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4024 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4025 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4026 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4027 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4028 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4029 | run_test "Large packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4030 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4031 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4032 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4033 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4034 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4035 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4036 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4037 | run_test "Large packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4038 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4039 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4040 | 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] | 4041 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4042 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4043 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4044 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4045 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4046 | run_test "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4047 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4048 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4049 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4050 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4051 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4052 | |
| 4053 | run_test "Large packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4054 | "$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] | 4055 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4056 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4057 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4058 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4059 | |
| 4060 | run_test "Large packet TLS 1.0 StreamCipher, without EtM" \ |
| 4061 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4062 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4063 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4064 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4065 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4066 | |
| 4067 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4068 | run_test "Large packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4069 | "$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] | 4070 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4071 | 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] | 4072 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4073 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4074 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4075 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4076 | run_test "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4077 | "$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] | 4078 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4079 | 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] | 4080 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4081 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4082 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4083 | |
| 4084 | run_test "Large packet TLS 1.1 BlockCipher" \ |
| 4085 | "$P_SRV" \ |
| 4086 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4087 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4088 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4089 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4090 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4091 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4092 | run_test "Large packet TLS 1.1 BlockCipher, without EtM" \ |
| 4093 | "$P_SRV" \ |
| 4094 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4095 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4096 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4097 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4098 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4099 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4100 | run_test "Large packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4101 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4102 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4103 | 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] | 4104 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4105 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4106 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4108 | run_test "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4109 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4110 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4111 | 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] | 4112 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4113 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4114 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4115 | run_test "Large packet TLS 1.1 StreamCipher" \ |
| 4116 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4117 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4118 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4119 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4120 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4121 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4122 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4123 | run_test "Large packet TLS 1.1 StreamCipher, without EtM" \ |
| 4124 | "$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] | 4125 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4126 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4127 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4128 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4129 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4130 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4131 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4132 | run_test "Large packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4133 | "$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] | 4134 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4135 | 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] | 4136 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4137 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4138 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4139 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4140 | run_test "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4141 | "$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] | 4142 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4143 | 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] | 4144 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4145 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4146 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4147 | |
| 4148 | run_test "Large packet TLS 1.2 BlockCipher" \ |
| 4149 | "$P_SRV" \ |
| 4150 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4151 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4152 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4153 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4154 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4155 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4156 | run_test "Large packet TLS 1.2 BlockCipher, without EtM" \ |
| 4157 | "$P_SRV" \ |
| 4158 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4159 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4160 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4161 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4162 | |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4163 | run_test "Large packet TLS 1.2 BlockCipher larger MAC" \ |
| 4164 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4165 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4166 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4167 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4168 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4169 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4170 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4171 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4172 | run_test "Large packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4173 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4174 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4175 | 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] | 4176 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4177 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4178 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4180 | run_test "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4181 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4182 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4183 | 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] | 4184 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4185 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4186 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4187 | |
| 4188 | run_test "Large packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4189 | "$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] | 4190 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4191 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4192 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4193 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4194 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4195 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4196 | run_test "Large packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4197 | "$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] | 4198 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4199 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4200 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4201 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4202 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4204 | run_test "Large packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4205 | "$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] | 4206 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4207 | 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] | 4208 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4209 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4210 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4211 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4212 | run_test "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4213 | "$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] | 4214 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4215 | 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] | 4216 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4217 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4218 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4219 | |
| 4220 | run_test "Large packet TLS 1.2 AEAD" \ |
| 4221 | "$P_SRV" \ |
| 4222 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4224 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4225 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4226 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4227 | |
| 4228 | run_test "Large packet TLS 1.2 AEAD shorter tag" \ |
| 4229 | "$P_SRV" \ |
| 4230 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4231 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4232 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame^] | 4233 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4234 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4235 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4236 | # Tests of asynchronous private key support in SSL |
| 4237 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4238 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4239 | run_test "SSL async private: sign, delay=0" \ |
| 4240 | "$P_SRV \ |
| 4241 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4242 | "$P_CLI" \ |
| 4243 | 0 \ |
| 4244 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4245 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4246 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4247 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4248 | run_test "SSL async private: sign, delay=1" \ |
| 4249 | "$P_SRV \ |
| 4250 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4251 | "$P_CLI" \ |
| 4252 | 0 \ |
| 4253 | -s "Async sign callback: using key slot " \ |
| 4254 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4255 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4256 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4258 | run_test "SSL async private: sign, delay=2" \ |
| 4259 | "$P_SRV \ |
| 4260 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 4261 | "$P_CLI" \ |
| 4262 | 0 \ |
| 4263 | -s "Async sign callback: using key slot " \ |
| 4264 | -U "Async sign callback: using key slot " \ |
| 4265 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 4266 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4267 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4268 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4269 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 4270 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 4271 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4272 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4273 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 4274 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 4275 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 4276 | "$P_CLI force_version=tls1_1" \ |
| 4277 | 0 \ |
| 4278 | -s "Async sign callback: using key slot " \ |
| 4279 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4280 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4282 | run_test "SSL async private: sign, SNI" \ |
| 4283 | "$P_SRV debug_level=3 \ |
| 4284 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 4285 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4286 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4287 | "$P_CLI server_name=polarssl.example" \ |
| 4288 | 0 \ |
| 4289 | -s "Async sign callback: using key slot " \ |
| 4290 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4291 | -s "parse ServerName extension" \ |
| 4292 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4293 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4294 | |
| 4295 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4296 | run_test "SSL async private: decrypt, delay=0" \ |
| 4297 | "$P_SRV \ |
| 4298 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4299 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4300 | 0 \ |
| 4301 | -s "Async decrypt callback: using key slot " \ |
| 4302 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4303 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4304 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4305 | run_test "SSL async private: decrypt, delay=1" \ |
| 4306 | "$P_SRV \ |
| 4307 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4308 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4309 | 0 \ |
| 4310 | -s "Async decrypt callback: using key slot " \ |
| 4311 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4312 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4313 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4314 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4315 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 4316 | "$P_SRV psk=abc123 \ |
| 4317 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 4318 | "$P_CLI psk=abc123 \ |
| 4319 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4320 | 0 \ |
| 4321 | -s "Async decrypt callback: using key slot " \ |
| 4322 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4323 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 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 RSA-PSK, delay=1" \ |
| 4326 | "$P_SRV psk=abc123 \ |
| 4327 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4328 | "$P_CLI psk=abc123 \ |
| 4329 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 4330 | 0 \ |
| 4331 | -s "Async decrypt callback: using key slot " \ |
| 4332 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 4333 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4334 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4335 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4336 | run_test "SSL async private: sign callback not present" \ |
| 4337 | "$P_SRV \ |
| 4338 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 4339 | "$P_CLI; [ \$? -eq 1 ] && |
| 4340 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4341 | 0 \ |
| 4342 | -S "Async sign callback" \ |
| 4343 | -s "! mbedtls_ssl_handshake returned" \ |
| 4344 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 4345 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 4346 | -s "Successful connection" |
| 4347 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4348 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4349 | run_test "SSL async private: decrypt callback not present" \ |
| 4350 | "$P_SRV debug_level=1 \ |
| 4351 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 4352 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 4353 | [ \$? -eq 1 ] && $P_CLI" \ |
| 4354 | 0 \ |
| 4355 | -S "Async decrypt callback" \ |
| 4356 | -s "! mbedtls_ssl_handshake returned" \ |
| 4357 | -s "got no RSA private key" \ |
| 4358 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 4359 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4360 | |
| 4361 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4362 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4363 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4364 | "$P_SRV \ |
| 4365 | async_operations=s async_private_delay1=1 \ |
| 4366 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4367 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4368 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4369 | 0 \ |
| 4370 | -s "Async sign callback: using key slot 0," \ |
| 4371 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4372 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4373 | |
| 4374 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4375 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4376 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4377 | "$P_SRV \ |
| 4378 | async_operations=s async_private_delay2=1 \ |
| 4379 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4380 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4381 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4382 | 0 \ |
| 4383 | -s "Async sign callback: using key slot 0," \ |
| 4384 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4385 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4386 | |
| 4387 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4388 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4389 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4390 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4391 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4392 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4393 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4394 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4395 | 0 \ |
| 4396 | -s "Async sign callback: using key slot 1," \ |
| 4397 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4398 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4399 | |
| 4400 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4401 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4402 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4403 | "$P_SRV \ |
| 4404 | async_operations=s async_private_delay1=1 \ |
| 4405 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4406 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4407 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4408 | 0 \ |
| 4409 | -s "Async sign callback: no key matches this certificate." |
| 4410 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4411 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4412 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4413 | "$P_SRV \ |
| 4414 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4415 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4416 | "$P_CLI" \ |
| 4417 | 1 \ |
| 4418 | -s "Async sign callback: injected error" \ |
| 4419 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4420 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4421 | -s "! mbedtls_ssl_handshake returned" |
| 4422 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4424 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4425 | "$P_SRV \ |
| 4426 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4427 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4428 | "$P_CLI" \ |
| 4429 | 1 \ |
| 4430 | -s "Async sign callback: using key slot " \ |
| 4431 | -S "Async resume" \ |
| 4432 | -s "Async cancel" |
| 4433 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4434 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4435 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4436 | "$P_SRV \ |
| 4437 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4438 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4439 | "$P_CLI" \ |
| 4440 | 1 \ |
| 4441 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4442 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4443 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4444 | -s "! mbedtls_ssl_handshake returned" |
| 4445 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4446 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4447 | run_test "SSL async private: decrypt, error in start" \ |
| 4448 | "$P_SRV \ |
| 4449 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4450 | async_private_error=1" \ |
| 4451 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4452 | 1 \ |
| 4453 | -s "Async decrypt callback: injected error" \ |
| 4454 | -S "Async resume" \ |
| 4455 | -S "Async cancel" \ |
| 4456 | -s "! mbedtls_ssl_handshake returned" |
| 4457 | |
| 4458 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4459 | run_test "SSL async private: decrypt, cancel after start" \ |
| 4460 | "$P_SRV \ |
| 4461 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4462 | async_private_error=2" \ |
| 4463 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4464 | 1 \ |
| 4465 | -s "Async decrypt callback: using key slot " \ |
| 4466 | -S "Async resume" \ |
| 4467 | -s "Async cancel" |
| 4468 | |
| 4469 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 4470 | run_test "SSL async private: decrypt, error in resume" \ |
| 4471 | "$P_SRV \ |
| 4472 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4473 | async_private_error=3" \ |
| 4474 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4475 | 1 \ |
| 4476 | -s "Async decrypt callback: using key slot " \ |
| 4477 | -s "Async resume callback: decrypt done but injected error" \ |
| 4478 | -S "Async cancel" \ |
| 4479 | -s "! mbedtls_ssl_handshake returned" |
| 4480 | |
| 4481 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4482 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4483 | "$P_SRV \ |
| 4484 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4485 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4486 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4487 | 0 \ |
| 4488 | -s "Async cancel" \ |
| 4489 | -s "! mbedtls_ssl_handshake returned" \ |
| 4490 | -s "Async resume" \ |
| 4491 | -s "Successful connection" |
| 4492 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4493 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4494 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4495 | "$P_SRV \ |
| 4496 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 4497 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4498 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 4499 | 0 \ |
| 4500 | -s "! mbedtls_ssl_handshake returned" \ |
| 4501 | -s "Async resume" \ |
| 4502 | -s "Successful connection" |
| 4503 | |
| 4504 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4505 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4506 | 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] | 4507 | "$P_SRV \ |
| 4508 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 4509 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4510 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4511 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4512 | [ \$? -eq 1 ] && |
| 4513 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4514 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4515 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4516 | -S "Async resume" \ |
| 4517 | -s "Async cancel" \ |
| 4518 | -s "! mbedtls_ssl_handshake returned" \ |
| 4519 | -s "Async sign callback: no key matches this certificate." \ |
| 4520 | -s "Successful connection" |
| 4521 | |
| 4522 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4524 | 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] | 4525 | "$P_SRV \ |
| 4526 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 4527 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 4528 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4529 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 4530 | [ \$? -eq 1 ] && |
| 4531 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 4532 | 0 \ |
| 4533 | -s "Async resume" \ |
| 4534 | -s "! mbedtls_ssl_handshake returned" \ |
| 4535 | -s "Async sign callback: no key matches this certificate." \ |
| 4536 | -s "Successful connection" |
| 4537 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4538 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4540 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 4541 | "$P_SRV \ |
| 4542 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4543 | exchanges=2 renegotiation=1" \ |
| 4544 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4545 | 0 \ |
| 4546 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4547 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4548 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4549 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4551 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 4552 | "$P_SRV \ |
| 4553 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4554 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4555 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 4556 | 0 \ |
| 4557 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4558 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 4559 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4560 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4561 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4562 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 4563 | "$P_SRV \ |
| 4564 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4565 | exchanges=2 renegotiation=1" \ |
| 4566 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 4567 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4568 | 0 \ |
| 4569 | -s "Async decrypt callback: using key slot " \ |
| 4570 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 4571 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4572 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 4574 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 4575 | "$P_SRV \ |
| 4576 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 4577 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4578 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 4579 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4580 | 0 \ |
| 4581 | -s "Async decrypt callback: using key slot " \ |
| 4582 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4583 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4584 | # Tests for DTLS HelloVerifyRequest |
| 4585 | |
| 4586 | run_test "DTLS cookie: enabled" \ |
| 4587 | "$P_SRV dtls=1 debug_level=2" \ |
| 4588 | "$P_CLI dtls=1 debug_level=2" \ |
| 4589 | 0 \ |
| 4590 | -s "cookie verification failed" \ |
| 4591 | -s "cookie verification passed" \ |
| 4592 | -S "cookie verification skipped" \ |
| 4593 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4594 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4595 | -S "SSL - The requested feature is not available" |
| 4596 | |
| 4597 | run_test "DTLS cookie: disabled" \ |
| 4598 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4599 | "$P_CLI dtls=1 debug_level=2" \ |
| 4600 | 0 \ |
| 4601 | -S "cookie verification failed" \ |
| 4602 | -S "cookie verification passed" \ |
| 4603 | -s "cookie verification skipped" \ |
| 4604 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4605 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4606 | -S "SSL - The requested feature is not available" |
| 4607 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4608 | run_test "DTLS cookie: default (failing)" \ |
| 4609 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4610 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4611 | 1 \ |
| 4612 | -s "cookie verification failed" \ |
| 4613 | -S "cookie verification passed" \ |
| 4614 | -S "cookie verification skipped" \ |
| 4615 | -C "received hello verify request" \ |
| 4616 | -S "hello verification requested" \ |
| 4617 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4618 | |
| 4619 | requires_ipv6 |
| 4620 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4621 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4622 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4623 | 0 \ |
| 4624 | -s "cookie verification failed" \ |
| 4625 | -s "cookie verification passed" \ |
| 4626 | -S "cookie verification skipped" \ |
| 4627 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4628 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4629 | -S "SSL - The requested feature is not available" |
| 4630 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4631 | run_test "DTLS cookie: enabled, nbio" \ |
| 4632 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 4633 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4634 | 0 \ |
| 4635 | -s "cookie verification failed" \ |
| 4636 | -s "cookie verification passed" \ |
| 4637 | -S "cookie verification skipped" \ |
| 4638 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4639 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4640 | -S "SSL - The requested feature is not available" |
| 4641 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4642 | # Tests for client reconnecting from the same port with DTLS |
| 4643 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4644 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4645 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4646 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4647 | "$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] | 4648 | 0 \ |
| 4649 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4650 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4651 | -S "Client initiated reconnection from same port" |
| 4652 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4653 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4654 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4655 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4656 | "$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] | 4657 | 0 \ |
| 4658 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4659 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4660 | -s "Client initiated reconnection from same port" |
| 4661 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4662 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4663 | 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] | 4664 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4665 | "$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] | 4666 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4667 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4668 | -s "Client initiated reconnection from same port" |
| 4669 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4670 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 4671 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 4672 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 4673 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4674 | 0 \ |
| 4675 | -S "The operation timed out" \ |
| 4676 | -s "Client initiated reconnection from same port" |
| 4677 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4678 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 4679 | "$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] | 4680 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4681 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4682 | -s "The operation timed out" \ |
| 4683 | -S "Client initiated reconnection from same port" |
| 4684 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4685 | # Tests for various cases of client authentication with DTLS |
| 4686 | # (focused on handshake flows and message parsing) |
| 4687 | |
| 4688 | run_test "DTLS client auth: required" \ |
| 4689 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4690 | "$P_CLI dtls=1" \ |
| 4691 | 0 \ |
| 4692 | -s "Verifying peer X.509 certificate... ok" |
| 4693 | |
| 4694 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4695 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4696 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4697 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4698 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4699 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4700 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4701 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4702 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4703 | 0 \ |
| 4704 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4705 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4706 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4707 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4708 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4709 | "$P_CLI dtls=1 psk=abc124" \ |
| 4710 | 1 \ |
| 4711 | -s "SSL - Verification of the message MAC failed" \ |
| 4712 | -c "SSL - A fatal alert message was received from our peer" |
| 4713 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4714 | # Tests for receiving fragmented handshake messages with DTLS |
| 4715 | |
| 4716 | requires_gnutls |
| 4717 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4718 | "$G_SRV -u --mtu 2048 -a" \ |
| 4719 | "$P_CLI dtls=1 debug_level=2" \ |
| 4720 | 0 \ |
| 4721 | -C "found fragmented DTLS handshake message" \ |
| 4722 | -C "error" |
| 4723 | |
| 4724 | requires_gnutls |
| 4725 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4726 | "$G_SRV -u --mtu 512" \ |
| 4727 | "$P_CLI dtls=1 debug_level=2" \ |
| 4728 | 0 \ |
| 4729 | -c "found fragmented DTLS handshake message" \ |
| 4730 | -C "error" |
| 4731 | |
| 4732 | requires_gnutls |
| 4733 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 4734 | "$G_SRV -u --mtu 128" \ |
| 4735 | "$P_CLI dtls=1 debug_level=2" \ |
| 4736 | 0 \ |
| 4737 | -c "found fragmented DTLS handshake message" \ |
| 4738 | -C "error" |
| 4739 | |
| 4740 | requires_gnutls |
| 4741 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 4742 | "$G_SRV -u --mtu 128" \ |
| 4743 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4744 | 0 \ |
| 4745 | -c "found fragmented DTLS handshake message" \ |
| 4746 | -C "error" |
| 4747 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4748 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4750 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4751 | "$G_SRV -u --mtu 256" \ |
| 4752 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4753 | 0 \ |
| 4754 | -c "found fragmented DTLS handshake message" \ |
| 4755 | -c "client hello, adding renegotiation extension" \ |
| 4756 | -c "found renegotiation extension" \ |
| 4757 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4758 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4759 | -C "error" \ |
| 4760 | -s "Extra-header:" |
| 4761 | |
| 4762 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4763 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4764 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4765 | "$G_SRV -u --mtu 256" \ |
| 4766 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4767 | 0 \ |
| 4768 | -c "found fragmented DTLS handshake message" \ |
| 4769 | -c "client hello, adding renegotiation extension" \ |
| 4770 | -c "found renegotiation extension" \ |
| 4771 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4772 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4773 | -C "error" \ |
| 4774 | -s "Extra-header:" |
| 4775 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4776 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4777 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4778 | "$P_CLI dtls=1 debug_level=2" \ |
| 4779 | 0 \ |
| 4780 | -C "found fragmented DTLS handshake message" \ |
| 4781 | -C "error" |
| 4782 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4783 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4784 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4785 | "$P_CLI dtls=1 debug_level=2" \ |
| 4786 | 0 \ |
| 4787 | -c "found fragmented DTLS handshake message" \ |
| 4788 | -C "error" |
| 4789 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4790 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4791 | "$O_SRV -dtls1 -mtu 256" \ |
| 4792 | "$P_CLI dtls=1 debug_level=2" \ |
| 4793 | 0 \ |
| 4794 | -c "found fragmented DTLS handshake message" \ |
| 4795 | -C "error" |
| 4796 | |
| 4797 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4798 | "$O_SRV -dtls1 -mtu 256" \ |
| 4799 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4800 | 0 \ |
| 4801 | -c "found fragmented DTLS handshake message" \ |
| 4802 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4803 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4804 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4805 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4806 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4807 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4808 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4809 | "$P_SRV dtls=1 debug_level=2" \ |
| 4810 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4811 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4812 | -C "replayed record" \ |
| 4813 | -S "replayed record" \ |
| 4814 | -C "record from another epoch" \ |
| 4815 | -S "record from another epoch" \ |
| 4816 | -C "discarding invalid record" \ |
| 4817 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4818 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4819 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4820 | -c "HTTP/1.0 200 OK" |
| 4821 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4822 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4823 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4824 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4825 | "$P_SRV dtls=1 debug_level=2" \ |
| 4826 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4827 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4828 | -c "replayed record" \ |
| 4829 | -s "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4830 | -c "record from another epoch" \ |
| 4831 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4832 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4833 | -s "Extra-header:" \ |
| 4834 | -c "HTTP/1.0 200 OK" |
| 4835 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4836 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 4837 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4838 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 4839 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4840 | 0 \ |
| 4841 | -c "replayed record" \ |
| 4842 | -S "replayed record" \ |
Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4843 | -c "record from another epoch" \ |
| 4844 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4845 | -c "resend" \ |
| 4846 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4847 | -s "Extra-header:" \ |
| 4848 | -c "HTTP/1.0 200 OK" |
| 4849 | |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4850 | run_test "DTLS proxy: multiple records in same datagram" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4851 | -p "$P_PXY pack=50" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4852 | "$P_SRV dtls=1 debug_level=2" \ |
| 4853 | "$P_CLI dtls=1 debug_level=2" \ |
| 4854 | 0 \ |
| 4855 | -c "next record in same datagram" \ |
| 4856 | -s "next record in same datagram" |
| 4857 | |
| 4858 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4859 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4860 | "$P_SRV dtls=1 debug_level=2" \ |
| 4861 | "$P_CLI dtls=1 debug_level=2" \ |
| 4862 | 0 \ |
| 4863 | -c "next record in same datagram" \ |
| 4864 | -s "next record in same datagram" |
| 4865 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4866 | 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] | 4867 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4868 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4869 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4870 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4871 | -c "discarding invalid record (mac)" \ |
| 4872 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4873 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4874 | -c "HTTP/1.0 200 OK" \ |
| 4875 | -S "too many records with bad MAC" \ |
| 4876 | -S "Verification of the message MAC failed" |
| 4877 | |
| 4878 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 4879 | -p "$P_PXY bad_ad=1" \ |
| 4880 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 4881 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4882 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4883 | -C "discarding invalid record (mac)" \ |
| 4884 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4885 | -S "Extra-header:" \ |
| 4886 | -C "HTTP/1.0 200 OK" \ |
| 4887 | -s "too many records with bad MAC" \ |
| 4888 | -s "Verification of the message MAC failed" |
| 4889 | |
| 4890 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 4891 | -p "$P_PXY bad_ad=1" \ |
| 4892 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 4893 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4894 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4895 | -c "discarding invalid record (mac)" \ |
| 4896 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4897 | -s "Extra-header:" \ |
| 4898 | -c "HTTP/1.0 200 OK" \ |
| 4899 | -S "too many records with bad MAC" \ |
| 4900 | -S "Verification of the message MAC failed" |
| 4901 | |
| 4902 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 4903 | -p "$P_PXY bad_ad=1" \ |
| 4904 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 4905 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 4906 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4907 | -c "discarding invalid record (mac)" \ |
| 4908 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4909 | -s "Extra-header:" \ |
| 4910 | -c "HTTP/1.0 200 OK" \ |
| 4911 | -s "too many records with bad MAC" \ |
| 4912 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4913 | |
| 4914 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4915 | -p "$P_PXY delay_ccs=1" \ |
| 4916 | "$P_SRV dtls=1 debug_level=1" \ |
| 4917 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4918 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4919 | -c "record from another epoch" \ |
| 4920 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4921 | -s "Extra-header:" \ |
| 4922 | -c "HTTP/1.0 200 OK" |
| 4923 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4924 | # 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] | 4925 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4926 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4927 | 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] | 4928 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4929 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4930 | psk=abc123" \ |
| 4931 | "$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] | 4932 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4933 | 0 \ |
| 4934 | -s "Extra-header:" \ |
| 4935 | -c "HTTP/1.0 200 OK" |
| 4936 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4937 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4938 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 4939 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4940 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4941 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4942 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4943 | 0 \ |
| 4944 | -s "Extra-header:" \ |
| 4945 | -c "HTTP/1.0 200 OK" |
| 4946 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4947 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4948 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 4949 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4950 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4951 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4952 | 0 \ |
| 4953 | -s "Extra-header:" \ |
| 4954 | -c "HTTP/1.0 200 OK" |
| 4955 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4956 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4957 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 4958 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4959 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 4960 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4961 | 0 \ |
| 4962 | -s "Extra-header:" \ |
| 4963 | -c "HTTP/1.0 200 OK" |
| 4964 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4965 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4966 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 4967 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4968 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 4969 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4970 | 0 \ |
| 4971 | -s "Extra-header:" \ |
| 4972 | -c "HTTP/1.0 200 OK" |
| 4973 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4974 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4975 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 4976 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4977 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 4978 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4979 | 0 \ |
| 4980 | -s "Extra-header:" \ |
| 4981 | -c "HTTP/1.0 200 OK" |
| 4982 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4983 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4984 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 4985 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4986 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 4987 | auth_mode=required" \ |
| 4988 | "$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] | 4989 | 0 \ |
| 4990 | -s "Extra-header:" \ |
| 4991 | -c "HTTP/1.0 200 OK" |
| 4992 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4993 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 4994 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 4995 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 4996 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4997 | psk=abc123 debug_level=3" \ |
| 4998 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 4999 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5000 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5001 | 0 \ |
| 5002 | -s "a session has been resumed" \ |
| 5003 | -c "a session has been resumed" \ |
| 5004 | -s "Extra-header:" \ |
| 5005 | -c "HTTP/1.0 200 OK" |
| 5006 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5007 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 5008 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 5009 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5010 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5011 | psk=abc123 debug_level=3 nbio=2" \ |
| 5012 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5013 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 5014 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 5015 | 0 \ |
| 5016 | -s "a session has been resumed" \ |
| 5017 | -c "a session has been resumed" \ |
| 5018 | -s "Extra-header:" \ |
| 5019 | -c "HTTP/1.0 200 OK" |
| 5020 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5021 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5022 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5023 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5024 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5025 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5026 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5027 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5028 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 5029 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5030 | 0 \ |
| 5031 | -c "=> renegotiate" \ |
| 5032 | -s "=> renegotiate" \ |
| 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 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5037 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5038 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 5039 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 5040 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 5041 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 5042 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 5043 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5044 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5045 | 0 \ |
| 5046 | -c "=> renegotiate" \ |
| 5047 | -s "=> renegotiate" \ |
| 5048 | -s "Extra-header:" \ |
| 5049 | -c "HTTP/1.0 200 OK" |
| 5050 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5051 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5052 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5053 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 5054 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5055 | "$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] | 5056 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5057 | debug_level=2" \ |
| 5058 | "$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] | 5059 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5060 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5061 | 0 \ |
| 5062 | -c "=> renegotiate" \ |
| 5063 | -s "=> renegotiate" \ |
| 5064 | -s "Extra-header:" \ |
| 5065 | -c "HTTP/1.0 200 OK" |
| 5066 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5067 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5069 | 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] | 5070 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5071 | "$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] | 5072 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5073 | debug_level=2 nbio=2" \ |
| 5074 | "$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] | 5075 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5076 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5077 | 0 \ |
| 5078 | -c "=> renegotiate" \ |
| 5079 | -s "=> renegotiate" \ |
| 5080 | -s "Extra-header:" \ |
| 5081 | -c "HTTP/1.0 200 OK" |
| 5082 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5083 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5084 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5085 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5086 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5087 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5088 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5089 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5090 | -c "HTTP/1.0 200 OK" |
| 5091 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5092 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5093 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5094 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 5095 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5096 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5097 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5098 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5099 | -c "HTTP/1.0 200 OK" |
| 5100 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5101 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5102 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5103 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 5104 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5105 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5106 | "$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] | 5107 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5108 | -c "HTTP/1.0 200 OK" |
| 5109 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5110 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5111 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5112 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5113 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 5114 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5115 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5116 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5117 | 0 \ |
| 5118 | -s "Extra-header:" \ |
| 5119 | -c "Extra-header:" |
| 5120 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5121 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5122 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5123 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5124 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 5125 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5126 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5127 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5128 | 0 \ |
| 5129 | -s "Extra-header:" \ |
| 5130 | -c "Extra-header:" |
| 5131 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5132 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5133 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5134 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5135 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 5136 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5137 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5138 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5139 | 0 \ |
| 5140 | -s "Extra-header:" \ |
| 5141 | -c "Extra-header:" |
| 5142 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5143 | # Final report |
| 5144 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5145 | echo "------------------------------------------------------------------------" |
| 5146 | |
| 5147 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5148 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5149 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5150 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5151 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 5152 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 5153 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5154 | |
| 5155 | exit $FAILS |