| 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 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 24 | # default values, can be overriden by the environment | 
|  | 25 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 26 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 27 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 28 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 29 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 30 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 31 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 33 | 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] | 34 | 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] | 35 | 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] | 36 | 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] | 37 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 38 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 39 | TESTS=0 | 
|  | 40 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 41 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 42 |  | 
| Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 43 | CONFIG_H='../include/mbedtls/config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 44 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 45 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 46 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 47 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 48 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 49 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 50 | RUN_TEST_NUMBER='' | 
|  | 51 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 52 | PRESERVE_LOGS=0 | 
|  | 53 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 54 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 55 | # port which is this plus 10000. Each port number may be independently | 
|  | 56 | # overridden by a command line option. | 
|  | 57 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 58 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 59 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 60 | print_usage() { | 
|  | 61 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 62 | printf "  -h|--help\tPrint this help.\n" | 
|  | 63 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 64 | printf "  -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" | 
|  | 65 | printf "  -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 66 | 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] | 67 | 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] | 68 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 69 | printf "     --port\tTCP/UDP port (default: randomish 1xxxx)\n" | 
|  | 70 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 71 | 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] | 72 | } | 
|  | 73 |  | 
|  | 74 | get_options() { | 
|  | 75 | while [ $# -gt 0 ]; do | 
|  | 76 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 77 | -f|--filter) | 
|  | 78 | shift; FILTER=$1 | 
|  | 79 | ;; | 
|  | 80 | -e|--exclude) | 
|  | 81 | shift; EXCLUDE=$1 | 
|  | 82 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 83 | -m|--memcheck) | 
|  | 84 | MEMCHECK=1 | 
|  | 85 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 86 | -n|--number) | 
|  | 87 | shift; RUN_TEST_NUMBER=$1 | 
|  | 88 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 89 | -s|--show-numbers) | 
|  | 90 | SHOW_TEST_NUMBER=1 | 
|  | 91 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 92 | -p|--preserve-logs) | 
|  | 93 | PRESERVE_LOGS=1 | 
|  | 94 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 95 | --port) | 
|  | 96 | shift; SRV_PORT=$1 | 
|  | 97 | ;; | 
|  | 98 | --proxy-port) | 
|  | 99 | shift; PXY_PORT=$1 | 
|  | 100 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 101 | --seed) | 
|  | 102 | shift; SEED="$1" | 
|  | 103 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 104 | -h|--help) | 
|  | 105 | print_usage | 
|  | 106 | exit 0 | 
|  | 107 | ;; | 
|  | 108 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 109 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | print_usage | 
|  | 111 | exit 1 | 
|  | 112 | ;; | 
|  | 113 | esac | 
|  | 114 | shift | 
|  | 115 | done | 
|  | 116 | } | 
|  | 117 |  | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 118 | # skip next test if the flag is not enabled in config.h | 
|  | 119 | requires_config_enabled() { | 
|  | 120 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else | 
|  | 121 | SKIP_NEXT="YES" | 
|  | 122 | fi | 
|  | 123 | } | 
|  | 124 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 125 | # skip next test if the flag is enabled in config.h | 
|  | 126 | requires_config_disabled() { | 
|  | 127 | if grep "^#define $1" $CONFIG_H > /dev/null; then | 
|  | 128 | SKIP_NEXT="YES" | 
|  | 129 | fi | 
|  | 130 | } | 
|  | 131 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 132 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 133 | requires_openssl_with_fallback_scsv() { | 
|  | 134 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 135 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 136 | then | 
|  | 137 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 138 | else | 
|  | 139 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 140 | fi | 
|  | 141 | fi | 
|  | 142 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 143 | SKIP_NEXT="YES" | 
|  | 144 | fi | 
|  | 145 | } | 
|  | 146 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 147 | # skip next test if GnuTLS isn't available | 
|  | 148 | requires_gnutls() { | 
|  | 149 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 150 | 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] | 151 | GNUTLS_AVAILABLE="YES" | 
|  | 152 | else | 
|  | 153 | GNUTLS_AVAILABLE="NO" | 
|  | 154 | fi | 
|  | 155 | fi | 
|  | 156 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 157 | SKIP_NEXT="YES" | 
|  | 158 | fi | 
|  | 159 | } | 
|  | 160 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 161 | # skip next test if IPv6 isn't available on this host | 
|  | 162 | requires_ipv6() { | 
|  | 163 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 164 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 165 | SRV_PID=$! | 
|  | 166 | sleep 1 | 
|  | 167 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 168 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 169 | HAS_IPV6="NO" | 
|  | 170 | else | 
|  | 171 | HAS_IPV6="YES" | 
|  | 172 | fi | 
|  | 173 | rm -r $SRV_OUT | 
|  | 174 | fi | 
|  | 175 |  | 
|  | 176 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 177 | SKIP_NEXT="YES" | 
|  | 178 | fi | 
|  | 179 | } | 
|  | 180 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 181 | # skip the next test if valgrind is in use | 
|  | 182 | not_with_valgrind() { | 
|  | 183 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 184 | SKIP_NEXT="YES" | 
|  | 185 | fi | 
|  | 186 | } | 
|  | 187 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 188 | # skip the next test if valgrind is NOT in use | 
|  | 189 | only_with_valgrind() { | 
|  | 190 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 191 | SKIP_NEXT="YES" | 
|  | 192 | fi | 
|  | 193 | } | 
|  | 194 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 195 | # 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] | 196 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 197 | CLI_DELAY_FACTOR=$1 | 
|  | 198 | } | 
|  | 199 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 200 | # wait for the given seconds after the client finished in the next test | 
|  | 201 | server_needs_more_time() { | 
|  | 202 | SRV_DELAY_SECONDS=$1 | 
|  | 203 | } | 
|  | 204 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 205 | # print_name <name> | 
|  | 206 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 207 | TESTS=$(( $TESTS + 1 )) | 
|  | 208 | LINE="" | 
|  | 209 |  | 
|  | 210 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 211 | LINE="$TESTS " | 
|  | 212 | fi | 
|  | 213 |  | 
|  | 214 | LINE="$LINE$1" | 
|  | 215 | printf "$LINE " | 
|  | 216 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 217 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 218 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 219 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 220 | } | 
|  | 221 |  | 
|  | 222 | # fail <message> | 
|  | 223 | fail() { | 
|  | 224 | echo "FAIL" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 225 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 226 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 227 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 228 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 229 | if [ -n "$PXY_CMD" ]; then | 
|  | 230 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 231 | fi | 
|  | 232 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 233 |  | 
| Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 234 | 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] | 235 | echo "  ! server output:" | 
|  | 236 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 237 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 238 | echo "  ! client output:" | 
|  | 239 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 240 | if [ -n "$PXY_CMD" ]; then | 
|  | 241 | echo "  ! ========================================================" | 
|  | 242 | echo "  ! proxy output:" | 
|  | 243 | cat o-pxy-${TESTS}.log | 
|  | 244 | fi | 
|  | 245 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 246 | fi | 
|  | 247 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 248 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 249 | } | 
|  | 250 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 251 | # is_polar <cmd_line> | 
|  | 252 | is_polar() { | 
|  | 253 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null | 
|  | 254 | } | 
|  | 255 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 256 | # openssl s_server doesn't have -www with DTLS | 
|  | 257 | check_osrv_dtls() { | 
|  | 258 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then | 
|  | 259 | NEEDS_INPUT=1 | 
|  | 260 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" | 
|  | 261 | else | 
|  | 262 | NEEDS_INPUT=0 | 
|  | 263 | fi | 
|  | 264 | } | 
|  | 265 |  | 
|  | 266 | # provide input to commands that need it | 
|  | 267 | provide_input() { | 
|  | 268 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 269 | return | 
|  | 270 | fi | 
|  | 271 |  | 
|  | 272 | while true; do | 
|  | 273 | echo "HTTP/1.0 200 OK" | 
|  | 274 | sleep 1 | 
|  | 275 | done | 
|  | 276 | } | 
|  | 277 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 278 | # has_mem_err <log_file_name> | 
|  | 279 | has_mem_err() { | 
|  | 280 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 281 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 282 | then | 
|  | 283 | return 1 # false: does not have errors | 
|  | 284 | else | 
|  | 285 | return 0 # true: has errors | 
|  | 286 | fi | 
|  | 287 | } | 
|  | 288 |  | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 289 | # Wait for process $2 to be listening on port $1 | 
|  | 290 | if type lsof >/dev/null 2>/dev/null; then | 
|  | 291 | wait_server_start() { | 
|  | 292 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 293 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 294 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 295 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 296 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 297 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 298 | # Make a tight loop, server normally takes less than 1s to start. | 
|  | 299 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do | 
|  | 300 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
|  | 301 | echo "SERVERSTART TIMEOUT" | 
|  | 302 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT | 
|  | 303 | break | 
|  | 304 | fi | 
|  | 305 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 306 | # OSes this may be a tight loop. | 
|  | 307 | sleep 0.1 2>/dev/null || true | 
|  | 308 | done | 
|  | 309 | } | 
|  | 310 | else | 
| Gilles Peskine | 3c9e2b5 | 2018-01-08 12:38:15 +0100 | [diff] [blame] | 311 | echo "Warning: lsof not available, wait_server_start = sleep $START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 312 | wait_server_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 313 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 314 | } | 
|  | 315 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 316 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 317 | # 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] | 318 | # 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] | 319 | # acceptable bounds | 
|  | 320 | check_server_hello_time() { | 
|  | 321 | # 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] | 322 | 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] | 323 | # Get the Unix timestamp for now | 
|  | 324 | CUR_TIME=$(date +'%s') | 
|  | 325 | THRESHOLD_IN_SECS=300 | 
|  | 326 |  | 
|  | 327 | # Check if the ServerHello time was printed | 
|  | 328 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 329 | return 1 | 
|  | 330 | fi | 
|  | 331 |  | 
|  | 332 | # Check the time in ServerHello is within acceptable bounds | 
|  | 333 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 334 | # The time in ServerHello is at least 5 minutes before now | 
|  | 335 | return 1 | 
|  | 336 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 337 | # 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] | 338 | return 1 | 
|  | 339 | else | 
|  | 340 | return 0 | 
|  | 341 | fi | 
|  | 342 | } | 
|  | 343 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 344 | # wait for client to terminate and set CLI_EXIT | 
|  | 345 | # must be called right after starting the client | 
|  | 346 | wait_client_done() { | 
|  | 347 | CLI_PID=$! | 
|  | 348 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 349 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 350 | CLI_DELAY_FACTOR=1 | 
|  | 351 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 352 | ( 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] | 353 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 354 |  | 
|  | 355 | wait $CLI_PID | 
|  | 356 | CLI_EXIT=$? | 
|  | 357 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 358 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 359 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 360 |  | 
|  | 361 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 362 |  | 
|  | 363 | sleep $SRV_DELAY_SECONDS | 
|  | 364 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 365 | } | 
|  | 366 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 367 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 368 | detect_dtls() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 369 | 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] | 370 | DTLS=1 | 
|  | 371 | else | 
|  | 372 | DTLS=0 | 
|  | 373 | fi | 
|  | 374 | } | 
|  | 375 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 376 | # 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] | 377 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 378 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 379 | #           -u pattern  lines after pattern must be unique in client output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 380 | #           -f call shell function on client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 381 | #           -S pattern  pattern that must be absent in server output | 
|  | 382 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 383 | #           -U pattern  lines after pattern must be unique in server output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 384 | #           -F call shell function on server output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 385 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 386 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 387 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 388 |  | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 389 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : | 
|  | 390 | else | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 391 | SKIP_NEXT="NO" | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 392 | return | 
|  | 393 | fi | 
|  | 394 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 395 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 396 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 397 | # Do we only run numbered tests? | 
|  | 398 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : | 
|  | 399 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : | 
|  | 400 | else | 
|  | 401 | SKIP_NEXT="YES" | 
|  | 402 | fi | 
|  | 403 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 404 | # should we skip? | 
|  | 405 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 406 | SKIP_NEXT="NO" | 
|  | 407 | echo "SKIP" | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 408 | SKIPS=$(( $SKIPS + 1 )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 409 | return | 
|  | 410 | fi | 
|  | 411 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 412 | # does this test use a proxy? | 
|  | 413 | if [ "X$1" = "X-p" ]; then | 
|  | 414 | PXY_CMD="$2" | 
|  | 415 | shift 2 | 
|  | 416 | else | 
|  | 417 | PXY_CMD="" | 
|  | 418 | fi | 
|  | 419 |  | 
|  | 420 | # get commands and client output | 
|  | 421 | SRV_CMD="$1" | 
|  | 422 | CLI_CMD="$2" | 
|  | 423 | CLI_EXPECT="$3" | 
|  | 424 | shift 3 | 
|  | 425 |  | 
|  | 426 | # fix client port | 
|  | 427 | if [ -n "$PXY_CMD" ]; then | 
|  | 428 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 429 | else | 
|  | 430 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 431 | fi | 
|  | 432 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 433 | # update DTLS variable | 
|  | 434 | detect_dtls "$SRV_CMD" | 
|  | 435 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 436 | # prepend valgrind to our commands if active | 
|  | 437 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 438 | if is_polar "$SRV_CMD"; then | 
|  | 439 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 440 | fi | 
|  | 441 | if is_polar "$CLI_CMD"; then | 
|  | 442 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 443 | fi | 
|  | 444 | fi | 
|  | 445 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 446 | TIMES_LEFT=2 | 
|  | 447 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 448 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 449 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 450 | # run the commands | 
|  | 451 | if [ -n "$PXY_CMD" ]; then | 
|  | 452 | echo "$PXY_CMD" > $PXY_OUT | 
|  | 453 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 454 | PXY_PID=$! | 
|  | 455 | # assume proxy starts faster than server | 
|  | 456 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 457 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 458 | check_osrv_dtls | 
|  | 459 | echo "$SRV_CMD" > $SRV_OUT | 
|  | 460 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 461 | SRV_PID=$! | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 462 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 463 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 464 | echo "$CLI_CMD" > $CLI_OUT | 
|  | 465 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 466 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 467 |  | 
| Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 468 | sleep 0.05 | 
|  | 469 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 470 | # terminate the server (and the proxy) | 
|  | 471 | kill $SRV_PID | 
|  | 472 | wait $SRV_PID | 
| Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 473 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 474 | if [ -n "$PXY_CMD" ]; then | 
|  | 475 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 476 | wait $PXY_PID | 
|  | 477 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 478 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 479 | # retry only on timeouts | 
|  | 480 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 481 | printf "RETRY " | 
|  | 482 | else | 
|  | 483 | TIMES_LEFT=0 | 
|  | 484 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 485 | done | 
|  | 486 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 487 | # 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] | 488 | # (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] | 489 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 490 | # failure) | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 491 | if is_polar "$SRV_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 492 | 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] | 493 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 494 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 495 | return | 
|  | 496 | fi | 
|  | 497 | fi | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 498 | if is_polar "$CLI_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 499 | 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] | 500 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 501 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 502 | return | 
|  | 503 | fi | 
|  | 504 | fi | 
|  | 505 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 506 | # check server exit code | 
|  | 507 | if [ $? != 0 ]; then | 
|  | 508 | fail "server fail" | 
|  | 509 | return | 
|  | 510 | fi | 
|  | 511 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 512 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 513 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 514 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 515 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 516 | 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] | 517 | return | 
|  | 518 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 519 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 520 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 521 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 522 | # 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] | 523 | while [ $# -gt 0 ] | 
|  | 524 | do | 
|  | 525 | case $1 in | 
|  | 526 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 527 | 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] | 528 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 529 | return | 
|  | 530 | fi | 
|  | 531 | ;; | 
|  | 532 |  | 
|  | 533 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 534 | 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] | 535 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 536 | return | 
|  | 537 | fi | 
|  | 538 | ;; | 
|  | 539 |  | 
|  | 540 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 541 | 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] | 542 | 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] | 543 | return | 
|  | 544 | fi | 
|  | 545 | ;; | 
|  | 546 |  | 
|  | 547 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 548 | 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] | 549 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 550 | return | 
|  | 551 | fi | 
|  | 552 | ;; | 
|  | 553 |  | 
|  | 554 | # The filtering in the following two options (-u and -U) do the following | 
|  | 555 | #   - ignore valgrind output | 
|  | 556 | #   - filter out everything but lines right after the pattern occurances | 
|  | 557 | #   - keep one of each non-unique line | 
|  | 558 | #   - count how many lines remain | 
|  | 559 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 560 | # if there were no duplicates. | 
|  | 561 | "-U") | 
|  | 562 | 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 | 
|  | 563 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 564 | return | 
|  | 565 | fi | 
|  | 566 | ;; | 
|  | 567 |  | 
|  | 568 | "-u") | 
|  | 569 | 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 | 
|  | 570 | 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] | 571 | return | 
|  | 572 | fi | 
|  | 573 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 574 | "-F") | 
|  | 575 | if ! $2 "$SRV_OUT"; then | 
|  | 576 | fail "function call to '$2' failed on Server output" | 
|  | 577 | return | 
|  | 578 | fi | 
|  | 579 | ;; | 
|  | 580 | "-f") | 
|  | 581 | if ! $2 "$CLI_OUT"; then | 
|  | 582 | fail "function call to '$2' failed on Client output" | 
|  | 583 | return | 
|  | 584 | fi | 
|  | 585 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 586 |  | 
|  | 587 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 588 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 589 | exit 1 | 
|  | 590 | esac | 
|  | 591 | shift 2 | 
|  | 592 | done | 
|  | 593 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 594 | # check valgrind's results | 
|  | 595 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 596 | 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] | 597 | fail "Server has memory errors" | 
|  | 598 | return | 
|  | 599 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 600 | 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] | 601 | fail "Client has memory errors" | 
|  | 602 | return | 
|  | 603 | fi | 
|  | 604 | fi | 
|  | 605 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 606 | # if we're here, everything is ok | 
|  | 607 | echo "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 608 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 609 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 610 | mv $CLI_OUT o-cli-${TESTS}.log | 
|  | 611 | fi | 
|  | 612 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 613 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 614 | } | 
|  | 615 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 616 | cleanup() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 617 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 618 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 619 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 620 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 621 | 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] | 622 | exit 1 | 
|  | 623 | } | 
|  | 624 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 625 | # | 
|  | 626 | # MAIN | 
|  | 627 | # | 
|  | 628 |  | 
| Manuel Pégourié-Gonnard | 19db8ea | 2015-03-10 13:41:04 +0000 | [diff] [blame] | 629 | if cd $( dirname $0 ); then :; else | 
|  | 630 | echo "cd $( dirname $0 ) failed" >&2 | 
|  | 631 | exit 1 | 
|  | 632 | fi | 
|  | 633 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 634 | get_options "$@" | 
|  | 635 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 636 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 637 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 638 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 639 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 640 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 641 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 642 | exit 1 | 
|  | 643 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 644 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 645 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 646 | exit 1 | 
|  | 647 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 648 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 649 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 650 | exit 1 | 
|  | 651 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 652 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 653 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 654 | echo "Memcheck not possible. Valgrind not found" | 
|  | 655 | exit 1 | 
|  | 656 | fi | 
|  | 657 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 658 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 659 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 660 | exit 1 | 
|  | 661 | fi | 
|  | 662 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 663 | # used by watchdog | 
|  | 664 | MAIN_PID="$$" | 
|  | 665 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 666 | # We use somewhat arbitrary delays for tests: | 
|  | 667 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 668 | # - how long do we allow for the client to finish? | 
|  | 669 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 670 | # Things are slower with valgrind, so give extra time here. | 
|  | 671 | # | 
|  | 672 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 673 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 674 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 675 | # 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] | 676 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 677 | START_DELAY=6 | 
|  | 678 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 679 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 680 | START_DELAY=2 | 
|  | 681 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 682 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 683 |  | 
|  | 684 | # some particular tests need more time: | 
|  | 685 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 686 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 687 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 688 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 689 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 690 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 691 | # 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] | 692 | # +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] | 693 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 694 | 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] | 695 | 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] | 696 | 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] | 697 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" | 
|  | 698 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 699 | G_CLI="$G_CLI -p +SRV_PORT localhost" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 700 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 701 | # Allow SHA-1, because many of our test certificates use it | 
|  | 702 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 703 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 704 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 705 | # Also pick a unique name for intermediate files | 
|  | 706 | SRV_OUT="srv_out.$$" | 
|  | 707 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 708 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 709 | SESSION="session.$$" | 
|  | 710 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 711 | SKIP_NEXT="NO" | 
|  | 712 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 713 | trap cleanup INT TERM HUP | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 714 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 715 | # Basic test | 
|  | 716 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 717 | # Checks that: | 
|  | 718 | # - things work with all ciphersuites active (used with config-full in all.sh) | 
|  | 719 | # - the expected (highest security) parameters are selected | 
|  | 720 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 721 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 722 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 723 | "$P_CLI" \ | 
|  | 724 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 725 | -s "Protocol is TLSv1.2" \ | 
|  | 726 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 727 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 728 | -s "ECDHE curve: secp521r1" \ | 
|  | 729 | -S "error" \ | 
|  | 730 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 731 |  | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 732 | run_test    "Default, DTLS" \ | 
|  | 733 | "$P_SRV dtls=1" \ | 
|  | 734 | "$P_CLI dtls=1" \ | 
|  | 735 | 0 \ | 
|  | 736 | -s "Protocol is DTLSv1.2" \ | 
|  | 737 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" | 
|  | 738 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 739 | # Test current time in ServerHello | 
|  | 740 | requires_config_enabled MBEDTLS_HAVE_TIME | 
|  | 741 | run_test    "Default, ServerHello contains gmt_unix_time" \ | 
|  | 742 | "$P_SRV debug_level=3" \ | 
|  | 743 | "$P_CLI debug_level=3" \ | 
|  | 744 | 0 \ | 
|  | 745 | -s "Protocol is TLSv1.2" \ | 
|  | 746 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 747 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 748 | -s "ECDHE curve: secp521r1" \ | 
|  | 749 | -S "error" \ | 
|  | 750 | -C "error" \ | 
|  | 751 | -f "check_server_hello_time" \ | 
|  | 752 | -F "check_server_hello_time" | 
|  | 753 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 754 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 755 | run_test    "Unique IV in GCM" \ | 
|  | 756 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 757 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 758 | 0 \ | 
|  | 759 | -u "IV used" \ | 
|  | 760 | -U "IV used" | 
|  | 761 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 762 | # Tests for rc4 option | 
|  | 763 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 764 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 765 | run_test    "RC4: server disabled, client enabled" \ | 
|  | 766 | "$P_SRV" \ | 
|  | 767 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 768 | 1 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 769 | -s "SSL - The server has no ciphersuites in common" | 
|  | 770 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 771 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 772 | run_test    "RC4: server half, client enabled" \ | 
|  | 773 | "$P_SRV arc4=1" \ | 
|  | 774 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 775 | 1 \ | 
|  | 776 | -s "SSL - The server has no ciphersuites in common" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 777 |  | 
|  | 778 | run_test    "RC4: server enabled, client disabled" \ | 
|  | 779 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 780 | "$P_CLI" \ | 
|  | 781 | 1 \ | 
|  | 782 | -s "SSL - The server has no ciphersuites in common" | 
|  | 783 |  | 
|  | 784 | run_test    "RC4: both enabled" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 785 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 786 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 787 | 0 \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 788 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 789 | -S "SSL - The server has no ciphersuites in common" | 
|  | 790 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 791 | # Tests for SHA-1 support | 
|  | 792 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 793 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 794 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 795 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 796 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 797 | 1 \ | 
|  | 798 | -c "The certificate is signed with an unacceptable hash" | 
|  | 799 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 800 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 801 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 802 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 803 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 804 | 0 | 
|  | 805 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 806 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 807 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 808 | "$P_CLI allow_sha1=1" \ | 
|  | 809 | 0 | 
|  | 810 |  | 
|  | 811 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 812 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 813 | "$P_CLI allow_sha1=0" \ | 
|  | 814 | 0 | 
|  | 815 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 816 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 817 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 818 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 819 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 820 | 1 \ | 
|  | 821 | -s "The certificate is signed with an unacceptable hash" | 
|  | 822 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 823 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 824 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 825 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 826 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 827 | 0 | 
|  | 828 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 829 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 830 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 831 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 832 | 0 | 
|  | 833 |  | 
|  | 834 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 835 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 836 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 837 | 0 | 
|  | 838 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 839 | # Tests for Truncated HMAC extension | 
|  | 840 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 841 | run_test    "Truncated HMAC: client default, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 842 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 843 | "$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] | 844 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 845 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 846 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 847 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 848 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 849 | run_test    "Truncated HMAC: client disabled, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 850 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 851 | "$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] | 852 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 853 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 854 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 855 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 856 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 857 | run_test    "Truncated HMAC: client enabled, server default" \ | 
|  | 858 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 859 | "$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] | 860 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 861 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 862 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 863 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 864 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 865 | run_test    "Truncated HMAC: client enabled, server disabled" \ | 
|  | 866 | "$P_SRV debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 867 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 868 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 869 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 870 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 871 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 872 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 873 | run_test    "Truncated HMAC: client disabled, server enabled" \ | 
|  | 874 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 875 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ | 
| Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 876 | 0 \ | 
|  | 877 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 878 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 879 |  | 
|  | 880 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 881 | run_test    "Truncated HMAC: client enabled, server enabled" \ | 
|  | 882 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 883 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 884 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 885 | -S "dumping 'expected mac' (20 bytes)" \ | 
|  | 886 | -s "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 887 |  | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 888 | run_test    "Truncated HMAC, DTLS: client default, server default" \ | 
|  | 889 | "$P_SRV dtls=1 debug_level=4" \ | 
|  | 890 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 891 | 0 \ | 
|  | 892 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 893 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 894 |  | 
|  | 895 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 896 | run_test    "Truncated HMAC, DTLS: client disabled, server default" \ | 
|  | 897 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 898 | "$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] | 899 | 0 \ | 
|  | 900 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 901 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 902 |  | 
|  | 903 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 904 | run_test    "Truncated HMAC, DTLS: client enabled, server default" \ | 
|  | 905 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 906 | "$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] | 907 | 0 \ | 
|  | 908 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 909 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 910 |  | 
|  | 911 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 912 | run_test    "Truncated HMAC, DTLS: client enabled, server disabled" \ | 
|  | 913 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 914 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 915 | 0 \ | 
|  | 916 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 917 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 918 |  | 
|  | 919 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 920 | run_test    "Truncated HMAC, DTLS: client disabled, server enabled" \ | 
|  | 921 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 922 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 923 | 0 \ | 
|  | 924 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 925 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 926 |  | 
|  | 927 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 928 | run_test    "Truncated HMAC, DTLS: client enabled, server enabled" \ | 
|  | 929 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 930 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 931 | 0 \ | 
|  | 932 | -S "dumping 'expected mac' (20 bytes)" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 933 | -s "dumping 'expected mac' (10 bytes)" | 
|  | 934 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 935 | # Tests for Encrypt-then-MAC extension | 
|  | 936 |  | 
|  | 937 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 938 | "$P_SRV debug_level=3 \ | 
|  | 939 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 940 | "$P_CLI debug_level=3" \ | 
|  | 941 | 0 \ | 
|  | 942 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 943 | -s "found encrypt then mac extension" \ | 
|  | 944 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 945 | -c "found encrypt_then_mac extension" \ | 
|  | 946 | -c "using encrypt then mac" \ | 
|  | 947 | -s "using encrypt then mac" | 
|  | 948 |  | 
|  | 949 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 950 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 951 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 952 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 953 | 0 \ | 
|  | 954 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 955 | -s "found encrypt then mac extension" \ | 
|  | 956 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 957 | -C "found encrypt_then_mac extension" \ | 
|  | 958 | -C "using encrypt then mac" \ | 
|  | 959 | -S "using encrypt then mac" | 
|  | 960 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 961 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 962 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 963 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 964 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 965 | 0 \ | 
|  | 966 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 967 | -s "found encrypt then mac extension" \ | 
|  | 968 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 969 | -C "found encrypt_then_mac extension" \ | 
|  | 970 | -C "using encrypt then mac" \ | 
|  | 971 | -S "using encrypt then mac" | 
|  | 972 |  | 
|  | 973 | run_test    "Encrypt then MAC: client enabled, stream cipher" \ | 
|  | 974 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 975 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 976 | "$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] | 977 | 0 \ | 
|  | 978 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 979 | -s "found encrypt then mac extension" \ | 
|  | 980 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 981 | -C "found encrypt_then_mac extension" \ | 
|  | 982 | -C "using encrypt then mac" \ | 
|  | 983 | -S "using encrypt then mac" | 
|  | 984 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 985 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 986 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 987 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 988 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 989 | 0 \ | 
|  | 990 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 991 | -S "found encrypt then mac extension" \ | 
|  | 992 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 993 | -C "found encrypt_then_mac extension" \ | 
|  | 994 | -C "using encrypt then mac" \ | 
|  | 995 | -S "using encrypt then mac" | 
|  | 996 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 997 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 998 | run_test    "Encrypt then MAC: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 999 | "$P_SRV debug_level=3 min_version=ssl3 \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1000 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1001 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 1002 | 0 \ | 
|  | 1003 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 1004 | -S "found encrypt then mac extension" \ | 
|  | 1005 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1006 | -C "found encrypt_then_mac extension" \ | 
|  | 1007 | -C "using encrypt then mac" \ | 
|  | 1008 | -S "using encrypt then mac" | 
|  | 1009 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1010 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1011 | run_test    "Encrypt then MAC: client enabled, server SSLv3" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1012 | "$P_SRV debug_level=3 force_version=ssl3 \ | 
|  | 1013 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1014 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1015 | 0 \ | 
|  | 1016 | -c "client hello, adding encrypt_then_mac extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1017 | -S "found encrypt then mac extension" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1018 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1019 | -C "found encrypt_then_mac extension" \ | 
|  | 1020 | -C "using encrypt then mac" \ | 
|  | 1021 | -S "using encrypt then mac" | 
|  | 1022 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1023 | # Tests for Extended Master Secret extension | 
|  | 1024 |  | 
|  | 1025 | run_test    "Extended Master Secret: default" \ | 
|  | 1026 | "$P_SRV debug_level=3" \ | 
|  | 1027 | "$P_CLI debug_level=3" \ | 
|  | 1028 | 0 \ | 
|  | 1029 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 1030 | -s "found extended master secret extension" \ | 
|  | 1031 | -s "server hello, adding extended master secret extension" \ | 
|  | 1032 | -c "found extended_master_secret extension" \ | 
|  | 1033 | -c "using extended master secret" \ | 
|  | 1034 | -s "using extended master secret" | 
|  | 1035 |  | 
|  | 1036 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 1037 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 1038 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 1039 | 0 \ | 
|  | 1040 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 1041 | -s "found extended master secret extension" \ | 
|  | 1042 | -S "server hello, adding extended master secret extension" \ | 
|  | 1043 | -C "found extended_master_secret extension" \ | 
|  | 1044 | -C "using extended master secret" \ | 
|  | 1045 | -S "using extended master secret" | 
|  | 1046 |  | 
|  | 1047 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 1048 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 1049 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 1050 | 0 \ | 
|  | 1051 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 1052 | -S "found extended master secret extension" \ | 
|  | 1053 | -S "server hello, adding extended master secret extension" \ | 
|  | 1054 | -C "found extended_master_secret extension" \ | 
|  | 1055 | -C "using extended master secret" \ | 
|  | 1056 | -S "using extended master secret" | 
|  | 1057 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1058 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1059 | run_test    "Extended Master Secret: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1060 | "$P_SRV debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1061 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 1062 | 0 \ | 
|  | 1063 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 1064 | -S "found extended master secret extension" \ | 
|  | 1065 | -S "server hello, adding extended master secret extension" \ | 
|  | 1066 | -C "found extended_master_secret extension" \ | 
|  | 1067 | -C "using extended master secret" \ | 
|  | 1068 | -S "using extended master secret" | 
|  | 1069 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1070 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1071 | run_test    "Extended Master Secret: client enabled, server SSLv3" \ | 
|  | 1072 | "$P_SRV debug_level=3 force_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1073 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1074 | 0 \ | 
|  | 1075 | -c "client hello, adding extended_master_secret extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1076 | -S "found extended master secret extension" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1077 | -S "server hello, adding extended master secret extension" \ | 
|  | 1078 | -C "found extended_master_secret extension" \ | 
|  | 1079 | -C "using extended master secret" \ | 
|  | 1080 | -S "using extended master secret" | 
|  | 1081 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1082 | # Tests for FALLBACK_SCSV | 
|  | 1083 |  | 
|  | 1084 | run_test    "Fallback SCSV: default" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1085 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1086 | "$P_CLI debug_level=3 force_version=tls1_1" \ | 
|  | 1087 | 0 \ | 
|  | 1088 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1089 | -S "received FALLBACK_SCSV" \ | 
|  | 1090 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1091 | -C "is a fatal alert message (msg 86)" | 
|  | 1092 |  | 
|  | 1093 | run_test    "Fallback SCSV: explicitly disabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1094 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1095 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 1096 | 0 \ | 
|  | 1097 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1098 | -S "received FALLBACK_SCSV" \ | 
|  | 1099 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1100 | -C "is a fatal alert message (msg 86)" | 
|  | 1101 |  | 
|  | 1102 | run_test    "Fallback SCSV: enabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1103 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1104 | "$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] | 1105 | 1 \ | 
|  | 1106 | -c "adding FALLBACK_SCSV" \ | 
|  | 1107 | -s "received FALLBACK_SCSV" \ | 
|  | 1108 | -s "inapropriate fallback" \ | 
|  | 1109 | -c "is a fatal alert message (msg 86)" | 
|  | 1110 |  | 
|  | 1111 | run_test    "Fallback SCSV: enabled, max version" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1112 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1113 | "$P_CLI debug_level=3 fallback=1" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1114 | 0 \ | 
|  | 1115 | -c "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1116 | -s "received FALLBACK_SCSV" \ | 
|  | 1117 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1118 | -C "is a fatal alert message (msg 86)" | 
|  | 1119 |  | 
|  | 1120 | requires_openssl_with_fallback_scsv | 
|  | 1121 | run_test    "Fallback SCSV: default, openssl server" \ | 
|  | 1122 | "$O_SRV" \ | 
|  | 1123 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 1124 | 0 \ | 
|  | 1125 | -C "adding FALLBACK_SCSV" \ | 
|  | 1126 | -C "is a fatal alert message (msg 86)" | 
|  | 1127 |  | 
|  | 1128 | requires_openssl_with_fallback_scsv | 
|  | 1129 | run_test    "Fallback SCSV: enabled, openssl server" \ | 
|  | 1130 | "$O_SRV" \ | 
|  | 1131 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ | 
|  | 1132 | 1 \ | 
|  | 1133 | -c "adding FALLBACK_SCSV" \ | 
|  | 1134 | -c "is a fatal alert message (msg 86)" | 
|  | 1135 |  | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1136 | requires_openssl_with_fallback_scsv | 
|  | 1137 | run_test    "Fallback SCSV: disabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1138 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1139 | "$O_CLI -tls1_1" \ | 
|  | 1140 | 0 \ | 
|  | 1141 | -S "received FALLBACK_SCSV" \ | 
|  | 1142 | -S "inapropriate fallback" | 
|  | 1143 |  | 
|  | 1144 | requires_openssl_with_fallback_scsv | 
|  | 1145 | run_test    "Fallback SCSV: enabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1146 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1147 | "$O_CLI -tls1_1 -fallback_scsv" \ | 
|  | 1148 | 1 \ | 
|  | 1149 | -s "received FALLBACK_SCSV" \ | 
|  | 1150 | -s "inapropriate fallback" | 
|  | 1151 |  | 
|  | 1152 | requires_openssl_with_fallback_scsv | 
|  | 1153 | run_test    "Fallback SCSV: enabled, max version, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1154 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1155 | "$O_CLI -fallback_scsv" \ | 
|  | 1156 | 0 \ | 
|  | 1157 | -s "received FALLBACK_SCSV" \ | 
|  | 1158 | -S "inapropriate fallback" | 
|  | 1159 |  | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1160 | ## ClientHello generated with | 
|  | 1161 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." | 
|  | 1162 | ## then manually twiddling the ciphersuite list. | 
|  | 1163 | ## The ClientHello content is spelled out below as a hex string as | 
|  | 1164 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". | 
|  | 1165 | ## The expected response is an inappropriate_fallback alert. | 
|  | 1166 | requires_openssl_with_fallback_scsv | 
|  | 1167 | run_test    "Fallback SCSV: beginning of list" \ | 
|  | 1168 | "$P_SRV debug_level=2" \ | 
|  | 1169 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1170 | 0 \ | 
|  | 1171 | -s "received FALLBACK_SCSV" \ | 
|  | 1172 | -s "inapropriate fallback" | 
|  | 1173 |  | 
|  | 1174 | requires_openssl_with_fallback_scsv | 
|  | 1175 | run_test    "Fallback SCSV: end of list" \ | 
|  | 1176 | "$P_SRV debug_level=2" \ | 
|  | 1177 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1178 | 0 \ | 
|  | 1179 | -s "received FALLBACK_SCSV" \ | 
|  | 1180 | -s "inapropriate fallback" | 
|  | 1181 |  | 
|  | 1182 | ## Here the expected response is a valid ServerHello prefix, up to the random. | 
|  | 1183 | requires_openssl_with_fallback_scsv | 
|  | 1184 | run_test    "Fallback SCSV: not in list" \ | 
|  | 1185 | "$P_SRV debug_level=2" \ | 
|  | 1186 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ | 
|  | 1187 | 0 \ | 
|  | 1188 | -S "received FALLBACK_SCSV" \ | 
|  | 1189 | -S "inapropriate fallback" | 
|  | 1190 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1191 | # Tests for CBC 1/n-1 record splitting | 
|  | 1192 |  | 
|  | 1193 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 1194 | "$P_SRV" \ | 
|  | 1195 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1196 | request_size=123 force_version=tls1_2" \ | 
|  | 1197 | 0 \ | 
|  | 1198 | -s "Read from client: 123 bytes read" \ | 
|  | 1199 | -S "Read from client: 1 bytes read" \ | 
|  | 1200 | -S "122 bytes read" | 
|  | 1201 |  | 
|  | 1202 | run_test    "CBC Record splitting: TLS 1.1, no splitting" \ | 
|  | 1203 | "$P_SRV" \ | 
|  | 1204 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1205 | request_size=123 force_version=tls1_1" \ | 
|  | 1206 | 0 \ | 
|  | 1207 | -s "Read from client: 123 bytes read" \ | 
|  | 1208 | -S "Read from client: 1 bytes read" \ | 
|  | 1209 | -S "122 bytes read" | 
|  | 1210 |  | 
|  | 1211 | run_test    "CBC Record splitting: TLS 1.0, splitting" \ | 
|  | 1212 | "$P_SRV" \ | 
|  | 1213 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1214 | request_size=123 force_version=tls1" \ | 
|  | 1215 | 0 \ | 
|  | 1216 | -S "Read from client: 123 bytes read" \ | 
|  | 1217 | -s "Read from client: 1 bytes read" \ | 
|  | 1218 | -s "122 bytes read" | 
|  | 1219 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1220 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1221 | run_test    "CBC Record splitting: SSLv3, splitting" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1222 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1223 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1224 | request_size=123 force_version=ssl3" \ | 
|  | 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 RC4, no splitting" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1231 | "$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] | 1232 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-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 |  | 
|  | 1239 | run_test    "CBC Record splitting: TLS 1.0, splitting disabled" \ | 
|  | 1240 | "$P_SRV" \ | 
|  | 1241 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1242 | request_size=123 force_version=tls1 recsplit=0" \ | 
|  | 1243 | 0 \ | 
|  | 1244 | -s "Read from client: 123 bytes read" \ | 
|  | 1245 | -S "Read from client: 1 bytes read" \ | 
|  | 1246 | -S "122 bytes read" | 
|  | 1247 |  | 
| Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1248 | run_test    "CBC Record splitting: TLS 1.0, splitting, nbio" \ | 
|  | 1249 | "$P_SRV nbio=2" \ | 
|  | 1250 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1251 | request_size=123 force_version=tls1" \ | 
|  | 1252 | 0 \ | 
|  | 1253 | -S "Read from client: 123 bytes read" \ | 
|  | 1254 | -s "Read from client: 1 bytes read" \ | 
|  | 1255 | -s "122 bytes read" | 
|  | 1256 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1257 | # Tests for Session Tickets | 
|  | 1258 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1259 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1260 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1261 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1262 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1263 | -c "client hello, adding session ticket extension" \ | 
|  | 1264 | -s "found session ticket extension" \ | 
|  | 1265 | -s "server hello, adding session ticket extension" \ | 
|  | 1266 | -c "found session_ticket extension" \ | 
|  | 1267 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1268 | -S "session successfully restored from cache" \ | 
|  | 1269 | -s "session successfully restored from ticket" \ | 
|  | 1270 | -s "a session has been resumed" \ | 
|  | 1271 | -c "a session has been resumed" | 
|  | 1272 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1273 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1274 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 1275 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1276 | 0 \ | 
|  | 1277 | -c "client hello, adding session ticket extension" \ | 
|  | 1278 | -s "found session ticket extension" \ | 
|  | 1279 | -s "server hello, adding session ticket extension" \ | 
|  | 1280 | -c "found session_ticket extension" \ | 
|  | 1281 | -c "parse new session ticket" \ | 
|  | 1282 | -S "session successfully restored from cache" \ | 
|  | 1283 | -s "session successfully restored from ticket" \ | 
|  | 1284 | -s "a session has been resumed" \ | 
|  | 1285 | -c "a session has been resumed" | 
|  | 1286 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1287 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1288 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 1289 | "$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] | 1290 | 0 \ | 
|  | 1291 | -c "client hello, adding session ticket extension" \ | 
|  | 1292 | -s "found session ticket extension" \ | 
|  | 1293 | -s "server hello, adding session ticket extension" \ | 
|  | 1294 | -c "found session_ticket extension" \ | 
|  | 1295 | -c "parse new session ticket" \ | 
|  | 1296 | -S "session successfully restored from cache" \ | 
|  | 1297 | -S "session successfully restored from ticket" \ | 
|  | 1298 | -S "a session has been resumed" \ | 
|  | 1299 | -C "a session has been resumed" | 
|  | 1300 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1301 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1302 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1303 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1304 | 0 \ | 
|  | 1305 | -c "client hello, adding session ticket extension" \ | 
|  | 1306 | -c "found session_ticket extension" \ | 
|  | 1307 | -c "parse new session ticket" \ | 
|  | 1308 | -c "a session has been resumed" | 
|  | 1309 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1310 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1311 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1312 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1313 | $O_CLI -sess_in $SESSION; \ | 
|  | 1314 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1315 | 0 \ | 
|  | 1316 | -s "found session ticket extension" \ | 
|  | 1317 | -s "server hello, adding session ticket extension" \ | 
|  | 1318 | -S "session successfully restored from cache" \ | 
|  | 1319 | -s "session successfully restored from ticket" \ | 
|  | 1320 | -s "a session has been resumed" | 
|  | 1321 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1322 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1323 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1324 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1325 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1326 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1327 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1328 | -c "client hello, adding session ticket extension" \ | 
|  | 1329 | -s "found session ticket extension" \ | 
|  | 1330 | -S "server hello, adding session ticket extension" \ | 
|  | 1331 | -C "found session_ticket extension" \ | 
|  | 1332 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1333 | -s "session successfully restored from cache" \ | 
|  | 1334 | -S "session successfully restored from ticket" \ | 
|  | 1335 | -s "a session has been resumed" \ | 
|  | 1336 | -c "a session has been resumed" | 
|  | 1337 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1338 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1339 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1340 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1341 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1342 | -C "client hello, adding session ticket extension" \ | 
|  | 1343 | -S "found session ticket extension" \ | 
|  | 1344 | -S "server hello, adding session ticket extension" \ | 
|  | 1345 | -C "found session_ticket extension" \ | 
|  | 1346 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1347 | -s "session successfully restored from cache" \ | 
|  | 1348 | -S "session successfully restored from ticket" \ | 
|  | 1349 | -s "a session has been resumed" \ | 
|  | 1350 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1351 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1352 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1353 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 1354 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1355 | 0 \ | 
|  | 1356 | -S "session successfully restored from cache" \ | 
|  | 1357 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1358 | -S "a session has been resumed" \ | 
|  | 1359 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1360 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1361 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1362 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 1363 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1364 | 0 \ | 
|  | 1365 | -s "session successfully restored from cache" \ | 
|  | 1366 | -S "session successfully restored from ticket" \ | 
|  | 1367 | -s "a session has been resumed" \ | 
|  | 1368 | -c "a session has been resumed" | 
|  | 1369 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1370 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1371 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1372 | "$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] | 1373 | 0 \ | 
|  | 1374 | -s "session successfully restored from cache" \ | 
|  | 1375 | -S "session successfully restored from ticket" \ | 
|  | 1376 | -s "a session has been resumed" \ | 
|  | 1377 | -c "a session has been resumed" | 
|  | 1378 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1379 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1380 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 1381 | "$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] | 1382 | 0 \ | 
|  | 1383 | -S "session successfully restored from cache" \ | 
|  | 1384 | -S "session successfully restored from ticket" \ | 
|  | 1385 | -S "a session has been resumed" \ | 
|  | 1386 | -C "a session has been resumed" | 
|  | 1387 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1388 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1389 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 1390 | "$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] | 1391 | 0 \ | 
|  | 1392 | -s "session successfully restored from cache" \ | 
|  | 1393 | -S "session successfully restored from ticket" \ | 
|  | 1394 | -s "a session has been resumed" \ | 
|  | 1395 | -c "a session has been resumed" | 
|  | 1396 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1397 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1398 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1399 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1400 | $O_CLI -sess_in $SESSION; \ | 
|  | 1401 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1402 | 0 \ | 
|  | 1403 | -s "found session ticket extension" \ | 
|  | 1404 | -S "server hello, adding session ticket extension" \ | 
|  | 1405 | -s "session successfully restored from cache" \ | 
|  | 1406 | -S "session successfully restored from ticket" \ | 
|  | 1407 | -s "a session has been resumed" | 
|  | 1408 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1409 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1410 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1411 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1412 | 0 \ | 
|  | 1413 | -C "found session_ticket extension" \ | 
|  | 1414 | -C "parse new session ticket" \ | 
|  | 1415 | -c "a session has been resumed" | 
|  | 1416 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1417 | # Tests for Max Fragment Length extension | 
|  | 1418 |  | 
| Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 1419 | MAX_CONTENT_LEN_EXPECT='16384' | 
|  | 1420 | MAX_CONTENT_LEN_CONFIG=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN) | 
|  | 1421 |  | 
|  | 1422 | if [ -n "$MAX_CONTENT_LEN_CONFIG" ] && [ "$MAX_CONTENT_LEN_CONFIG" -ne "$MAX_CONTENT_LEN_EXPECT" ]; then | 
|  | 1423 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" | 
|  | 1424 | printf "MBEDTLS_SSL_MAX_CONTENT_LEN that is different from the script’s\n" | 
|  | 1425 | printf "test value of ${MAX_CONTENT_LEN_EXPECT}. \n" | 
|  | 1426 | printf "\n" | 
|  | 1427 | printf "The tests assume this value and if it changes, the tests in this\n" | 
|  | 1428 | printf "script should also be adjusted.\n" | 
|  | 1429 | printf "\n" | 
|  | 1430 |  | 
|  | 1431 | exit 1 | 
|  | 1432 | fi | 
|  | 1433 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1434 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1435 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1436 | "$P_SRV debug_level=3" \ | 
|  | 1437 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1438 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1439 | -c "Maximum fragment length is 16384" \ | 
|  | 1440 | -s "Maximum fragment length is 16384" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1441 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1442 | -S "found max fragment length extension" \ | 
|  | 1443 | -S "server hello, max_fragment_length extension" \ | 
|  | 1444 | -C "found max_fragment_length extension" | 
|  | 1445 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1446 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1447 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 1448 | "$P_SRV debug_level=3" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1449 | "$P_CLI debug_level=3 request_size=16385" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1450 | 0 \ | 
|  | 1451 | -c "Maximum fragment length is 16384" \ | 
|  | 1452 | -s "Maximum fragment length is 16384" \ | 
|  | 1453 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1454 | -S "found max fragment length extension" \ | 
|  | 1455 | -S "server hello, max_fragment_length extension" \ | 
|  | 1456 | -C "found max_fragment_length extension" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1457 | -c "16385 bytes written in 2 fragments" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1458 | -s "16384 bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1459 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1460 |  | 
|  | 1461 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1462 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 1463 | "$P_SRV debug_level=3 dtls=1" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1464 | "$P_CLI debug_level=3 dtls=1 request_size=16385" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1465 | 1 \ | 
|  | 1466 | -c "Maximum fragment length is 16384" \ | 
|  | 1467 | -s "Maximum fragment length is 16384" \ | 
|  | 1468 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1469 | -S "found max fragment length extension" \ | 
|  | 1470 | -S "server hello, max_fragment_length extension" \ | 
|  | 1471 | -C "found max_fragment_length extension" \ | 
|  | 1472 | -c "fragment larger than.*maximum " | 
|  | 1473 |  | 
|  | 1474 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1475 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 1476 | "$P_SRV debug_level=3" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1477 | "$P_CLI debug_level=3 request_size=16385" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1478 | 0 \ | 
|  | 1479 | -C "Maximum fragment length is 16384" \ | 
|  | 1480 | -S "Maximum fragment length is 16384" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1481 | -c "16385 bytes written in 2 fragments" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1482 | -s "16384 bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1483 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1484 |  | 
|  | 1485 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1486 | run_test    "Max fragment length DTLS: disabled, larger message" \ | 
|  | 1487 | "$P_SRV debug_level=3 dtls=1" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1488 | "$P_CLI debug_level=3 dtls=1 request_size=16385" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1489 | 1 \ | 
|  | 1490 | -C "Maximum fragment length is 16384" \ | 
|  | 1491 | -S "Maximum fragment length is 16384" \ | 
|  | 1492 | -c "fragment larger than.*maximum " | 
|  | 1493 |  | 
|  | 1494 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1495 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1496 | "$P_SRV debug_level=3" \ | 
|  | 1497 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1498 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1499 | -c "Maximum fragment length is 4096" \ | 
|  | 1500 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1501 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1502 | -s "found max fragment length extension" \ | 
|  | 1503 | -s "server hello, max_fragment_length extension" \ | 
|  | 1504 | -c "found max_fragment_length extension" | 
|  | 1505 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1506 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1507 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1508 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 1509 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1510 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1511 | -c "Maximum fragment length is 16384" \ | 
|  | 1512 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1513 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1514 | -S "found max fragment length extension" \ | 
|  | 1515 | -S "server hello, max_fragment_length extension" \ | 
|  | 1516 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1517 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1518 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1519 | requires_gnutls | 
|  | 1520 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1521 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1522 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1523 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1524 | -c "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1525 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1526 | -c "found max_fragment_length extension" | 
|  | 1527 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1528 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1529 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 1530 | "$P_SRV debug_level=3" \ | 
|  | 1531 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 1532 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1533 | -c "Maximum fragment length is 2048" \ | 
|  | 1534 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1535 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1536 | -s "found max fragment length extension" \ | 
|  | 1537 | -s "server hello, max_fragment_length extension" \ | 
|  | 1538 | -c "found max_fragment_length extension" \ | 
|  | 1539 | -c "2048 bytes written in 1 fragments" \ | 
|  | 1540 | -s "2048 bytes read" | 
|  | 1541 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1542 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1543 | run_test    "Max fragment length: client, larger message" \ | 
|  | 1544 | "$P_SRV debug_level=3" \ | 
|  | 1545 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 1546 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1547 | -c "Maximum fragment length is 2048" \ | 
|  | 1548 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1549 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1550 | -s "found max fragment length extension" \ | 
|  | 1551 | -s "server hello, max_fragment_length extension" \ | 
|  | 1552 | -c "found max_fragment_length extension" \ | 
|  | 1553 | -c "2345 bytes written in 2 fragments" \ | 
|  | 1554 | -s "2048 bytes read" \ | 
|  | 1555 | -s "297 bytes read" | 
|  | 1556 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1557 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1558 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1559 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 1560 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 1561 | 1 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1562 | -c "Maximum fragment length is 2048" \ | 
|  | 1563 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1564 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1565 | -s "found max fragment length extension" \ | 
|  | 1566 | -s "server hello, max_fragment_length extension" \ | 
|  | 1567 | -c "found max_fragment_length extension" \ | 
|  | 1568 | -c "fragment larger than.*maximum" | 
|  | 1569 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1570 | # Tests for renegotiation | 
|  | 1571 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1572 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1573 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1574 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1575 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1576 | 0 \ | 
|  | 1577 | -C "client hello, adding renegotiation extension" \ | 
|  | 1578 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1579 | -S "found renegotiation extension" \ | 
|  | 1580 | -s "server hello, secure renegotiation extension" \ | 
|  | 1581 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1582 | -C "=> renegotiate" \ | 
|  | 1583 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1584 | -S "write hello request" | 
|  | 1585 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1587 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1588 | "$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] | 1589 | "$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] | 1590 | 0 \ | 
|  | 1591 | -c "client hello, adding renegotiation extension" \ | 
|  | 1592 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1593 | -s "found renegotiation extension" \ | 
|  | 1594 | -s "server hello, secure renegotiation extension" \ | 
|  | 1595 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1596 | -c "=> renegotiate" \ | 
|  | 1597 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1598 | -S "write hello request" | 
|  | 1599 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1600 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1601 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1602 | "$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] | 1603 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1604 | 0 \ | 
|  | 1605 | -c "client hello, adding renegotiation extension" \ | 
|  | 1606 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1607 | -s "found renegotiation extension" \ | 
|  | 1608 | -s "server hello, secure renegotiation extension" \ | 
|  | 1609 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1610 | -c "=> renegotiate" \ | 
|  | 1611 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1612 | -s "write hello request" | 
|  | 1613 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1614 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 1615 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 1616 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1618 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 1619 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 1620 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 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" \ | 
|  | 1627 | -c "=> renegotiate" \ | 
|  | 1628 | -s "=> renegotiate" \ | 
|  | 1629 | -S "write hello request" \ | 
|  | 1630 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 1631 |  | 
|  | 1632 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 1633 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 1634 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1636 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 1637 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 1638 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 1639 | 0 \ | 
|  | 1640 | -c "client hello, adding renegotiation extension" \ | 
|  | 1641 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1642 | -s "found renegotiation extension" \ | 
|  | 1643 | -s "server hello, secure renegotiation extension" \ | 
|  | 1644 | -c "found renegotiation extension" \ | 
|  | 1645 | -c "=> renegotiate" \ | 
|  | 1646 | -s "=> renegotiate" \ | 
|  | 1647 | -s "write hello request" \ | 
|  | 1648 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 1649 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1651 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1652 | "$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] | 1653 | "$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] | 1654 | 0 \ | 
|  | 1655 | -c "client hello, adding renegotiation extension" \ | 
|  | 1656 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1657 | -s "found renegotiation extension" \ | 
|  | 1658 | -s "server hello, secure renegotiation extension" \ | 
|  | 1659 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1660 | -c "=> renegotiate" \ | 
|  | 1661 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1662 | -s "write hello request" | 
|  | 1663 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1665 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1666 | "$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] | 1667 | "$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] | 1668 | 1 \ | 
|  | 1669 | -c "client hello, adding renegotiation extension" \ | 
|  | 1670 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1671 | -S "found renegotiation extension" \ | 
|  | 1672 | -s "server hello, secure renegotiation extension" \ | 
|  | 1673 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1674 | -c "=> renegotiate" \ | 
|  | 1675 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1676 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1677 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1678 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1679 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1680 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1681 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1682 | "$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] | 1683 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1684 | 0 \ | 
|  | 1685 | -C "client hello, adding renegotiation extension" \ | 
|  | 1686 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1687 | -S "found renegotiation extension" \ | 
|  | 1688 | -s "server hello, secure renegotiation extension" \ | 
|  | 1689 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1690 | -C "=> renegotiate" \ | 
|  | 1691 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1692 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1693 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1694 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1695 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1696 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1697 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1698 | "$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] | 1699 | renego_delay=-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 | fae355e | 2014-07-04 14:32:27 +0200 | [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" \ | 
|  | 1707 | -C "=> renegotiate" \ | 
|  | 1708 | -S "=> renegotiate" \ | 
|  | 1709 | -s "write hello request" \ | 
|  | 1710 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1711 | -S "failed" | 
|  | 1712 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1713 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1714 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1715 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1716 | "$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] | 1717 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1718 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1719 | 0 \ | 
|  | 1720 | -C "client hello, adding renegotiation extension" \ | 
|  | 1721 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1722 | -S "found renegotiation extension" \ | 
|  | 1723 | -s "server hello, secure renegotiation extension" \ | 
|  | 1724 | -c "found renegotiation extension" \ | 
|  | 1725 | -C "=> renegotiate" \ | 
|  | 1726 | -S "=> renegotiate" \ | 
|  | 1727 | -s "write hello request" \ | 
|  | 1728 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1729 | -S "failed" | 
|  | 1730 |  | 
| 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 0" \ | 
| 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=0 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" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1745 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1746 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1747 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1748 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1749 | "$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] | 1750 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1751 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1752 | 0 \ | 
|  | 1753 | -c "client hello, adding renegotiation extension" \ | 
|  | 1754 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1755 | -s "found renegotiation extension" \ | 
|  | 1756 | -s "server hello, secure renegotiation extension" \ | 
|  | 1757 | -c "found renegotiation extension" \ | 
|  | 1758 | -c "=> renegotiate" \ | 
|  | 1759 | -s "=> renegotiate" \ | 
|  | 1760 | -s "write hello request" \ | 
|  | 1761 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1762 | -S "failed" | 
|  | 1763 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1765 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1766 | "$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] | 1767 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 1768 | 0 \ | 
|  | 1769 | -C "client hello, adding renegotiation extension" \ | 
|  | 1770 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1771 | -S "found renegotiation extension" \ | 
|  | 1772 | -s "server hello, secure renegotiation extension" \ | 
|  | 1773 | -c "found renegotiation extension" \ | 
|  | 1774 | -S "record counter limit reached: renegotiate" \ | 
|  | 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 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1781 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1783 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1784 | "$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] | 1785 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1786 | 0 \ | 
|  | 1787 | -c "client hello, adding renegotiation extension" \ | 
|  | 1788 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1789 | -s "found renegotiation extension" \ | 
|  | 1790 | -s "server hello, secure renegotiation extension" \ | 
|  | 1791 | -c "found renegotiation extension" \ | 
|  | 1792 | -s "record counter limit reached: renegotiate" \ | 
|  | 1793 | -c "=> renegotiate" \ | 
|  | 1794 | -s "=> renegotiate" \ | 
|  | 1795 | -s "write hello request" \ | 
|  | 1796 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1797 | -S "failed" | 
|  | 1798 |  | 
| 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, two times 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=7 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, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1818 | "$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] | 1819 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1834 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1835 | "$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] | 1836 | "$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] | 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 | -c "=> renegotiate" \ | 
|  | 1844 | -s "=> renegotiate" \ | 
|  | 1845 | -S "write hello request" | 
|  | 1846 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1848 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1849 | "$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] | 1850 | "$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] | 1851 | 0 \ | 
|  | 1852 | -c "client hello, adding renegotiation extension" \ | 
|  | 1853 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1854 | -s "found renegotiation extension" \ | 
|  | 1855 | -s "server hello, secure renegotiation extension" \ | 
|  | 1856 | -c "found renegotiation extension" \ | 
|  | 1857 | -c "=> renegotiate" \ | 
|  | 1858 | -s "=> renegotiate" \ | 
|  | 1859 | -s "write hello request" | 
|  | 1860 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1861 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1862 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1863 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1864 | "$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] | 1865 | 0 \ | 
|  | 1866 | -c "client hello, adding renegotiation extension" \ | 
|  | 1867 | -c "found renegotiation extension" \ | 
|  | 1868 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1869 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1870 | -C "error" \ | 
|  | 1871 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1872 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1873 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1874 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1875 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 1876 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1877 | "$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] | 1878 | 0 \ | 
|  | 1879 | -c "client hello, adding renegotiation extension" \ | 
|  | 1880 | -c "found renegotiation extension" \ | 
|  | 1881 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1882 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1883 | -C "error" \ | 
|  | 1884 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1885 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1886 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1887 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1888 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 1889 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1890 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 1891 | 1 \ | 
|  | 1892 | -c "client hello, adding renegotiation extension" \ | 
|  | 1893 | -C "found renegotiation extension" \ | 
|  | 1894 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1895 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1896 | -c "error" \ | 
|  | 1897 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1898 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1899 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1900 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1901 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 1902 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1903 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 1904 | allow_legacy=0" \ | 
|  | 1905 | 1 \ | 
|  | 1906 | -c "client hello, adding renegotiation extension" \ | 
|  | 1907 | -C "found renegotiation extension" \ | 
|  | 1908 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1909 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1910 | -c "error" \ | 
|  | 1911 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1912 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1913 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1914 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1915 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 1916 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1917 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 1918 | allow_legacy=1" \ | 
|  | 1919 | 0 \ | 
|  | 1920 | -c "client hello, adding renegotiation extension" \ | 
|  | 1921 | -C "found renegotiation extension" \ | 
|  | 1922 | -c "=> renegotiate" \ | 
|  | 1923 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1924 | -C "error" \ | 
|  | 1925 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1926 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1927 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1928 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 1929 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 1930 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 1931 | 0 \ | 
|  | 1932 | -c "client hello, adding renegotiation extension" \ | 
|  | 1933 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1934 | -s "found renegotiation extension" \ | 
|  | 1935 | -s "server hello, secure renegotiation extension" \ | 
|  | 1936 | -c "found renegotiation extension" \ | 
|  | 1937 | -c "=> renegotiate" \ | 
|  | 1938 | -s "=> renegotiate" \ | 
|  | 1939 | -S "write hello request" | 
|  | 1940 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1941 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1942 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 1943 | "$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] | 1944 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 1945 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1946 | 0 \ | 
|  | 1947 | -c "client hello, adding renegotiation extension" \ | 
|  | 1948 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1949 | -s "found renegotiation extension" \ | 
|  | 1950 | -s "server hello, secure renegotiation extension" \ | 
|  | 1951 | -c "found renegotiation extension" \ | 
|  | 1952 | -c "=> renegotiate" \ | 
|  | 1953 | -s "=> renegotiate" \ | 
|  | 1954 | -s "write hello request" | 
|  | 1955 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 1957 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 1958 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 1959 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 1960 | 0 \ | 
|  | 1961 | -c "client hello, adding renegotiation extension" \ | 
|  | 1962 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1963 | -s "found renegotiation extension" \ | 
|  | 1964 | -s "server hello, secure renegotiation extension" \ | 
|  | 1965 | -s "record counter limit reached: renegotiate" \ | 
|  | 1966 | -c "=> renegotiate" \ | 
|  | 1967 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1968 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 1969 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 1970 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1972 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 1973 | "$G_SRV -u --mtu 4096" \ | 
|  | 1974 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 1975 | 0 \ | 
|  | 1976 | -c "client hello, adding renegotiation extension" \ | 
|  | 1977 | -c "found renegotiation extension" \ | 
|  | 1978 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1979 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1980 | -C "error" \ | 
|  | 1981 | -s "Extra-header:" | 
|  | 1982 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1983 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 1984 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1985 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1986 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 1987 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 1988 | "$P_CLI debug_level=3" \ | 
|  | 1989 | 0 \ | 
|  | 1990 | -c "found renegotiation extension" \ | 
|  | 1991 | -C "error" \ | 
|  | 1992 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1993 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1994 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1995 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 1996 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1997 | "$P_CLI debug_level=3" \ | 
|  | 1998 | 0 \ | 
|  | 1999 | -C "found renegotiation extension" \ | 
|  | 2000 | -C "error" \ | 
|  | 2001 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2002 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2003 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2004 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 2005 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2006 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 2007 | 1 \ | 
|  | 2008 | -C "found renegotiation extension" \ | 
|  | 2009 | -c "error" \ | 
|  | 2010 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2011 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2012 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2013 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 2014 | "$P_SRV debug_level=3" \ | 
|  | 2015 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 2016 | 0 \ | 
|  | 2017 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2018 | -s "server hello, secure renegotiation extension" | 
|  | 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 client unsafe, server default" \ | 
|  | 2022 | "$P_SRV debug_level=3" \ | 
|  | 2023 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2024 | 0 \ | 
|  | 2025 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2026 | -S "server hello, secure renegotiation extension" | 
|  | 2027 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2028 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2029 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 2030 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
|  | 2031 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2032 | 1 \ | 
|  | 2033 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2034 | -S "server hello, secure renegotiation extension" | 
|  | 2035 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2036 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 2037 |  | 
|  | 2038 | requires_gnutls | 
|  | 2039 | run_test    "DER format: no trailing bytes" \ | 
|  | 2040 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 2041 | key_file=data_files/server5.key" \ | 
|  | 2042 | "$G_CLI " \ | 
|  | 2043 | 0 \ | 
|  | 2044 | -c "Handshake was completed" \ | 
|  | 2045 |  | 
|  | 2046 | requires_gnutls | 
|  | 2047 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 2048 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 2049 | key_file=data_files/server5.key" \ | 
|  | 2050 | "$G_CLI " \ | 
|  | 2051 | 0 \ | 
|  | 2052 | -c "Handshake was completed" \ | 
|  | 2053 |  | 
|  | 2054 | requires_gnutls | 
|  | 2055 | run_test    "DER format: with a trailing random byte" \ | 
|  | 2056 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 2057 | key_file=data_files/server5.key" \ | 
|  | 2058 | "$G_CLI " \ | 
|  | 2059 | 0 \ | 
|  | 2060 | -c "Handshake was completed" \ | 
|  | 2061 |  | 
|  | 2062 | requires_gnutls | 
|  | 2063 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 2064 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 2065 | key_file=data_files/server5.key" \ | 
|  | 2066 | "$G_CLI " \ | 
|  | 2067 | 0 \ | 
|  | 2068 | -c "Handshake was completed" \ | 
|  | 2069 |  | 
|  | 2070 | requires_gnutls | 
|  | 2071 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 2072 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 2073 | key_file=data_files/server5.key" \ | 
|  | 2074 | "$G_CLI " \ | 
|  | 2075 | 0 \ | 
|  | 2076 | -c "Handshake was completed" \ | 
|  | 2077 |  | 
|  | 2078 | requires_gnutls | 
|  | 2079 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 2080 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 2081 | key_file=data_files/server5.key" \ | 
|  | 2082 | "$G_CLI " \ | 
|  | 2083 | 0 \ | 
|  | 2084 | -c "Handshake was completed" \ | 
|  | 2085 |  | 
|  | 2086 | requires_gnutls | 
|  | 2087 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 2088 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 2089 | key_file=data_files/server5.key" \ | 
|  | 2090 | "$G_CLI " \ | 
|  | 2091 | 0 \ | 
|  | 2092 | -c "Handshake was completed" \ | 
|  | 2093 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2094 | # Tests for auth_mode | 
|  | 2095 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2096 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2097 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 2098 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2099 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2100 | 1 \ | 
|  | 2101 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2102 | -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] | 2103 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2104 | -c "X509 - Certificate verification failed" | 
|  | 2105 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2106 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2107 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 2108 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2109 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2110 | 0 \ | 
|  | 2111 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2112 | -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] | 2113 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2114 | -C "X509 - Certificate verification failed" | 
|  | 2115 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2116 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 2117 | "$P_SRV" \ | 
|  | 2118 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 2119 | 0 \ | 
|  | 2120 | -c "x509_verify_cert() returned" \ | 
|  | 2121 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2122 | -c "! Certificate verification flags"\ | 
|  | 2123 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 2124 | -C "X509 - Certificate verification failed" \ | 
|  | 2125 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 2126 |  | 
|  | 2127 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 2128 | "$P_SRV" \ | 
|  | 2129 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 2130 | 1 \ | 
|  | 2131 | -c "x509_verify_cert() returned" \ | 
|  | 2132 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2133 | -c "! Certificate verification flags"\ | 
|  | 2134 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2135 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 2136 |  | 
|  | 2137 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 2138 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 2139 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 2140 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 2141 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 2142 | # different means to have the server ignoring the client's supported curve list. | 
|  | 2143 |  | 
|  | 2144 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 2145 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 2146 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 2147 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 2148 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 2149 | 1 \ | 
|  | 2150 | -c "bad certificate (EC key curve)"\ | 
|  | 2151 | -c "! Certificate verification flags"\ | 
|  | 2152 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 2153 |  | 
|  | 2154 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 2155 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 2156 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 2157 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 2158 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 2159 | 1 \ | 
|  | 2160 | -c "bad certificate (EC key curve)"\ | 
|  | 2161 | -c "! Certificate verification flags"\ | 
|  | 2162 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 2163 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2164 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2165 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2166 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2167 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2168 | 0 \ | 
|  | 2169 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2170 | -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] | 2171 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2172 | -C "X509 - Certificate verification failed" | 
|  | 2173 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2174 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 2175 | "$P_SRV auth_mode=required" \ | 
|  | 2176 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 2177 | key_file=data_files/server6.key \ | 
|  | 2178 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 2179 | 0 \ | 
|  | 2180 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 2181 | -c "Supported Signature Algorithm found: 5," | 
|  | 2182 |  | 
|  | 2183 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 2184 | "$P_SRV auth_mode=required" \ | 
|  | 2185 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 2186 | key_file=data_files/server6.key \ | 
|  | 2187 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2188 | 0 \ | 
|  | 2189 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 2190 | -c "Supported Signature Algorithm found: 5," | 
|  | 2191 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 2193 | run_test    "Authentication: client has no cert, server required (SSLv3)" \ | 
|  | 2194 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ | 
|  | 2195 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ | 
|  | 2196 | key_file=data_files/server5.key" \ | 
|  | 2197 | 1 \ | 
|  | 2198 | -S "skip write certificate request" \ | 
|  | 2199 | -C "skip parse certificate request" \ | 
|  | 2200 | -c "got a certificate request" \ | 
|  | 2201 | -c "got no certificate to send" \ | 
|  | 2202 | -S "x509_verify_cert() returned" \ | 
|  | 2203 | -s "client has no certificate" \ | 
|  | 2204 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2205 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2206 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 2207 |  | 
|  | 2208 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 2209 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2210 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 2211 | key_file=data_files/server5.key" \ | 
|  | 2212 | 1 \ | 
|  | 2213 | -S "skip write certificate request" \ | 
|  | 2214 | -C "skip parse certificate request" \ | 
|  | 2215 | -c "got a certificate request" \ | 
|  | 2216 | -c "= write certificate$" \ | 
|  | 2217 | -C "skip write certificate$" \ | 
|  | 2218 | -S "x509_verify_cert() returned" \ | 
|  | 2219 | -s "client has no certificate" \ | 
|  | 2220 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2221 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2222 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 2223 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2224 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2225 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2226 | "$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] | 2227 | key_file=data_files/server5.key" \ | 
|  | 2228 | 1 \ | 
|  | 2229 | -S "skip write certificate request" \ | 
|  | 2230 | -C "skip parse certificate request" \ | 
|  | 2231 | -c "got a certificate request" \ | 
|  | 2232 | -C "skip write certificate" \ | 
|  | 2233 | -C "skip write certificate verify" \ | 
|  | 2234 | -S "skip parse certificate verify" \ | 
|  | 2235 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2236 | -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] | 2237 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2238 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2239 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2240 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2241 | # We don't check that the client receives the alert because it might | 
|  | 2242 | # detect that its write end of the connection is closed and abort | 
|  | 2243 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2244 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2245 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 2246 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2247 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 2248 | key_file=data_files/server5.key" \ | 
|  | 2249 | 1 \ | 
|  | 2250 | -S "skip write certificate request" \ | 
|  | 2251 | -C "skip parse certificate request" \ | 
|  | 2252 | -c "got a certificate request" \ | 
|  | 2253 | -C "skip write certificate" \ | 
|  | 2254 | -C "skip write certificate verify" \ | 
|  | 2255 | -S "skip parse certificate verify" \ | 
|  | 2256 | -s "x509_verify_cert() returned" \ | 
|  | 2257 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2258 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2259 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2260 | -s "X509 - Certificate verification failed" | 
|  | 2261 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2262 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2263 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2264 | "$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] | 2265 | key_file=data_files/server5.key" \ | 
|  | 2266 | 0 \ | 
|  | 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" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2274 | -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] | 2275 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2276 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 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 none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2280 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 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 no 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 no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2297 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2298 | "$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] | 2299 | 0 \ | 
|  | 2300 | -S "skip write certificate request" \ | 
|  | 2301 | -C "skip parse certificate request" \ | 
|  | 2302 | -c "got a certificate request" \ | 
|  | 2303 | -C "skip write certificate$" \ | 
|  | 2304 | -C "got no certificate to send" \ | 
|  | 2305 | -S "SSLv3 client has no certificate" \ | 
|  | 2306 | -c "skip write certificate verify" \ | 
|  | 2307 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2308 | -s "! Certificate was missing" \ | 
| 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 | de515cc | 2014-02-27 14:58:26 +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: openssl 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" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2315 | "$O_CLI" \ | 
|  | 2316 | 0 \ | 
|  | 2317 | -S "skip write certificate request" \ | 
|  | 2318 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2319 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2320 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2321 | -S "X509 - Certificate verification failed" | 
|  | 2322 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2323 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2324 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2325 | "$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] | 2326 | 0 \ | 
|  | 2327 | -C "skip parse certificate request" \ | 
|  | 2328 | -c "got a certificate request" \ | 
|  | 2329 | -C "skip write certificate$" \ | 
|  | 2330 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2331 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2332 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2333 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 2334 | "$O_SRV -Verify 10" \ | 
|  | 2335 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 2336 | 1 \ | 
|  | 2337 | -C "skip parse certificate request" \ | 
|  | 2338 | -c "got a certificate request" \ | 
|  | 2339 | -C "skip write certificate$" \ | 
|  | 2340 | -c "skip write certificate verify" \ | 
|  | 2341 | -c "! mbedtls_ssl_handshake returned" | 
|  | 2342 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2343 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2344 | run_test    "Authentication: client no cert, ssl3" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2345 | "$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] | 2346 | "$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] | 2347 | 0 \ | 
|  | 2348 | -S "skip write certificate request" \ | 
|  | 2349 | -C "skip parse certificate request" \ | 
|  | 2350 | -c "got a certificate request" \ | 
|  | 2351 | -C "skip write certificate$" \ | 
|  | 2352 | -c "skip write certificate verify" \ | 
|  | 2353 | -c "got no certificate to send" \ | 
|  | 2354 | -s "SSLv3 client has no certificate" \ | 
|  | 2355 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2356 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2357 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2358 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2359 | -S "X509 - Certificate verification failed" | 
|  | 2360 |  | 
| Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2361 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its | 
|  | 2362 | # default value (8) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2363 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2364 | MAX_IM_CA='8' | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2365 | 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] | 2366 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2367 | 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] | 2368 | 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] | 2369 | 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] | 2370 | printf "test value of ${MAX_IM_CA}. \n" | 
|  | 2371 | printf "\n" | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2372 | printf "The tests assume this value and if it changes, the tests in this\n" | 
|  | 2373 | printf "script should also be adjusted.\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2374 | printf "\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2375 |  | 
|  | 2376 | exit 1 | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2377 | fi | 
|  | 2378 |  | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2379 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 2380 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2381 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2382 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2383 | 0 \ | 
|  | 2384 | -C "X509 - A fatal error occured" | 
|  | 2385 |  | 
|  | 2386 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 2387 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2388 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2389 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2390 | 1 \ | 
|  | 2391 | -c "X509 - A fatal error occured" | 
|  | 2392 |  | 
|  | 2393 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 2394 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2395 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2396 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2397 | auth_mode=optional" \ | 
|  | 2398 | 1 \ | 
|  | 2399 | -c "X509 - A fatal error occured" | 
|  | 2400 |  | 
|  | 2401 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 2402 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2403 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2404 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2405 | auth_mode=none" \ | 
|  | 2406 | 0 \ | 
|  | 2407 | -C "X509 - A fatal error occured" | 
|  | 2408 |  | 
|  | 2409 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 2410 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2411 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2412 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2413 | 0 \ | 
|  | 2414 | -S "X509 - A fatal error occured" | 
|  | 2415 |  | 
|  | 2416 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 2417 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 2418 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2419 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2420 | 1 \ | 
|  | 2421 | -s "X509 - A fatal error occured" | 
|  | 2422 |  | 
|  | 2423 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 2424 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2425 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2426 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2427 | 1 \ | 
|  | 2428 | -s "X509 - A fatal error occured" | 
|  | 2429 |  | 
|  | 2430 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 2431 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2432 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2433 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2434 | 0 \ | 
|  | 2435 | -S "X509 - A fatal error occured" | 
|  | 2436 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2437 | # Tests for CA list in CertificateRequest messages | 
|  | 2438 |  | 
|  | 2439 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 2440 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2441 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2442 | key_file=data_files/server6.key" \ | 
|  | 2443 | 0 \ | 
|  | 2444 | -s "requested DN" | 
|  | 2445 |  | 
|  | 2446 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 2447 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2448 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2449 | key_file=data_files/server6.key" \ | 
|  | 2450 | 0 \ | 
|  | 2451 | -S "requested DN" | 
|  | 2452 |  | 
|  | 2453 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 2454 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2455 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 2456 | key_file=data_files/server5.key" \ | 
|  | 2457 | 1 \ | 
|  | 2458 | -S "requested DN" \ | 
|  | 2459 | -s "x509_verify_cert() returned" \ | 
|  | 2460 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2461 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2462 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2463 | -s "X509 - Certificate verification failed" | 
|  | 2464 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2465 | # Tests for certificate selection based on SHA verson | 
|  | 2466 |  | 
|  | 2467 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 2468 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2469 | key_file=data_files/server5.key \ | 
|  | 2470 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2471 | key_file2=data_files/server5.key" \ | 
|  | 2472 | "$P_CLI force_version=tls1_2" \ | 
|  | 2473 | 0 \ | 
|  | 2474 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2475 | -C "signed using.*ECDSA with SHA1" | 
|  | 2476 |  | 
|  | 2477 | run_test    "Certificate hash: client TLS 1.1 -> SHA-1" \ | 
|  | 2478 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2479 | key_file=data_files/server5.key \ | 
|  | 2480 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2481 | key_file2=data_files/server5.key" \ | 
|  | 2482 | "$P_CLI force_version=tls1_1" \ | 
|  | 2483 | 0 \ | 
|  | 2484 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2485 | -c "signed using.*ECDSA with SHA1" | 
|  | 2486 |  | 
|  | 2487 | run_test    "Certificate hash: client TLS 1.0 -> SHA-1" \ | 
|  | 2488 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2489 | key_file=data_files/server5.key \ | 
|  | 2490 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2491 | key_file2=data_files/server5.key" \ | 
|  | 2492 | "$P_CLI force_version=tls1" \ | 
|  | 2493 | 0 \ | 
|  | 2494 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2495 | -c "signed using.*ECDSA with SHA1" | 
|  | 2496 |  | 
|  | 2497 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ | 
|  | 2498 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2499 | key_file=data_files/server5.key \ | 
|  | 2500 | crt_file2=data_files/server6.crt \ | 
|  | 2501 | key_file2=data_files/server6.key" \ | 
|  | 2502 | "$P_CLI force_version=tls1_1" \ | 
|  | 2503 | 0 \ | 
|  | 2504 | -c "serial number.*09" \ | 
|  | 2505 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2506 | -C "signed using.*ECDSA with SHA1" | 
|  | 2507 |  | 
|  | 2508 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ | 
|  | 2509 | "$P_SRV crt_file=data_files/server6.crt \ | 
|  | 2510 | key_file=data_files/server6.key \ | 
|  | 2511 | crt_file2=data_files/server5.crt \ | 
|  | 2512 | key_file2=data_files/server5.key" \ | 
|  | 2513 | "$P_CLI force_version=tls1_1" \ | 
|  | 2514 | 0 \ | 
|  | 2515 | -c "serial number.*0A" \ | 
|  | 2516 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2517 | -C "signed using.*ECDSA with SHA1" | 
|  | 2518 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2519 | # tests for SNI | 
|  | 2520 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2521 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2522 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2523 | 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] | 2524 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2525 | 0 \ | 
|  | 2526 | -S "parse ServerName extension" \ | 
|  | 2527 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 2528 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2529 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2530 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2531 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2532 | 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] | 2533 | 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] | 2534 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2535 | 0 \ | 
|  | 2536 | -s "parse ServerName extension" \ | 
|  | 2537 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2538 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2539 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2540 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2541 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2542 | 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] | 2543 | 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] | 2544 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2545 | 0 \ | 
|  | 2546 | -s "parse ServerName extension" \ | 
|  | 2547 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2548 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2549 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2550 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2551 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2552 | 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] | 2553 | 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] | 2554 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2555 | 1 \ | 
|  | 2556 | -s "parse ServerName extension" \ | 
|  | 2557 | -s "ssl_sni_wrapper() returned" \ | 
|  | 2558 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2559 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 2560 | -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] | 2561 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2562 | run_test    "SNI: client auth no override: optional" \ | 
|  | 2563 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2564 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2565 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 2566 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2567 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2568 | -S "skip write certificate request" \ | 
|  | 2569 | -C "skip parse certificate request" \ | 
|  | 2570 | -c "got a certificate request" \ | 
|  | 2571 | -C "skip write certificate" \ | 
|  | 2572 | -C "skip write certificate verify" \ | 
|  | 2573 | -S "skip parse certificate verify" | 
|  | 2574 |  | 
|  | 2575 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 2576 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 2577 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2578 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 2579 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2580 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2581 | -S "skip write certificate request" \ | 
|  | 2582 | -C "skip parse certificate request" \ | 
|  | 2583 | -c "got a certificate request" \ | 
|  | 2584 | -C "skip write certificate" \ | 
|  | 2585 | -C "skip write certificate verify" \ | 
|  | 2586 | -S "skip parse certificate verify" | 
|  | 2587 |  | 
|  | 2588 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 2589 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2590 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2591 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 2592 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2593 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2594 | -s "skip write certificate request" \ | 
|  | 2595 | -C "skip parse certificate request" \ | 
|  | 2596 | -c "got no certificate request" \ | 
|  | 2597 | -c "skip write certificate" \ | 
|  | 2598 | -c "skip write certificate verify" \ | 
|  | 2599 | -s "skip parse certificate verify" | 
|  | 2600 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2601 | run_test    "SNI: CA no override" \ | 
|  | 2602 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2603 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2604 | ca_file=data_files/test-ca.crt \ | 
|  | 2605 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 2606 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2607 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2608 | 1 \ | 
|  | 2609 | -S "skip write certificate request" \ | 
|  | 2610 | -C "skip parse certificate request" \ | 
|  | 2611 | -c "got a certificate request" \ | 
|  | 2612 | -C "skip write certificate" \ | 
|  | 2613 | -C "skip write certificate verify" \ | 
|  | 2614 | -S "skip parse certificate verify" \ | 
|  | 2615 | -s "x509_verify_cert() returned" \ | 
|  | 2616 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2617 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2618 |  | 
|  | 2619 | run_test    "SNI: CA override" \ | 
|  | 2620 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2621 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2622 | ca_file=data_files/test-ca.crt \ | 
|  | 2623 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 2624 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2625 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2626 | 0 \ | 
|  | 2627 | -S "skip write certificate request" \ | 
|  | 2628 | -C "skip parse certificate request" \ | 
|  | 2629 | -c "got a certificate request" \ | 
|  | 2630 | -C "skip write certificate" \ | 
|  | 2631 | -C "skip write certificate verify" \ | 
|  | 2632 | -S "skip parse certificate verify" \ | 
|  | 2633 | -S "x509_verify_cert() returned" \ | 
|  | 2634 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2635 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2636 |  | 
|  | 2637 | run_test    "SNI: CA override with CRL" \ | 
|  | 2638 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2639 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2640 | ca_file=data_files/test-ca.crt \ | 
|  | 2641 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 2642 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2643 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2644 | 1 \ | 
|  | 2645 | -S "skip write certificate request" \ | 
|  | 2646 | -C "skip parse certificate request" \ | 
|  | 2647 | -c "got a certificate request" \ | 
|  | 2648 | -C "skip write certificate" \ | 
|  | 2649 | -C "skip write certificate verify" \ | 
|  | 2650 | -S "skip parse certificate verify" \ | 
|  | 2651 | -s "x509_verify_cert() returned" \ | 
|  | 2652 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2653 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 2654 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2655 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 2656 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2657 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2658 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 2659 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2660 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2661 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2662 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2663 | -c "Read from server: .* bytes read" | 
|  | 2664 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2665 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2666 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 2667 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2668 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2669 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2670 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2671 | -c "Read from server: .* bytes read" | 
|  | 2672 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2673 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2674 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 2675 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 2676 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2677 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2678 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2679 | -c "Read from server: .* bytes read" | 
|  | 2680 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2681 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2682 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 2683 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 2684 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2685 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2686 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2687 | -c "Read from server: .* bytes read" | 
|  | 2688 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2689 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2690 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 2691 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 2692 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2693 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2694 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2695 | -c "Read from server: .* bytes read" | 
|  | 2696 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2697 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2698 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 2699 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 2700 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2701 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2702 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2703 | -c "Read from server: .* bytes read" | 
|  | 2704 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2705 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2706 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 2707 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 2708 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2709 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2710 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2711 | -c "Read from server: .* bytes read" | 
|  | 2712 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 2713 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 2714 |  | 
|  | 2715 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 2716 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 2717 | "$P_CLI event=1 tickets=0" \ | 
|  | 2718 | 0 \ | 
|  | 2719 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2720 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2721 | -c "Read from server: .* bytes read" | 
|  | 2722 |  | 
|  | 2723 | run_test    "Event-driven I/O: client auth" \ | 
|  | 2724 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 2725 | "$P_CLI event=1 tickets=0" \ | 
|  | 2726 | 0 \ | 
|  | 2727 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2728 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2729 | -c "Read from server: .* bytes read" | 
|  | 2730 |  | 
|  | 2731 | run_test    "Event-driven I/O: ticket" \ | 
|  | 2732 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 2733 | "$P_CLI event=1 tickets=1" \ | 
|  | 2734 | 0 \ | 
|  | 2735 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2736 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2737 | -c "Read from server: .* bytes read" | 
|  | 2738 |  | 
|  | 2739 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 2740 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 2741 | "$P_CLI event=1 tickets=1" \ | 
|  | 2742 | 0 \ | 
|  | 2743 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2744 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2745 | -c "Read from server: .* bytes read" | 
|  | 2746 |  | 
|  | 2747 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 2748 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 2749 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 2750 | 0 \ | 
|  | 2751 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2752 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2753 | -c "Read from server: .* bytes read" | 
|  | 2754 |  | 
|  | 2755 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 2756 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 2757 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 2758 | 0 \ | 
|  | 2759 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2760 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2761 | -c "Read from server: .* bytes read" | 
|  | 2762 |  | 
|  | 2763 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 2764 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 2765 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 2766 | 0 \ | 
|  | 2767 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2768 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 2769 | -c "Read from server: .* bytes read" | 
|  | 2770 |  | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 2771 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 2772 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 2773 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 2774 | 0 \ | 
|  | 2775 | -c "Read from server: .* bytes read" | 
|  | 2776 |  | 
|  | 2777 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 2778 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 2779 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 2780 | 0 \ | 
|  | 2781 | -c "Read from server: .* bytes read" | 
|  | 2782 |  | 
|  | 2783 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 2784 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 2785 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 2786 | 0 \ | 
|  | 2787 | -c "Read from server: .* bytes read" | 
|  | 2788 |  | 
|  | 2789 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 2790 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 2791 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 2792 | 0 \ | 
|  | 2793 | -c "Read from server: .* bytes read" | 
|  | 2794 |  | 
|  | 2795 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 2796 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 2797 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 2798 | 0 \ | 
|  | 2799 | -c "Read from server: .* bytes read" | 
|  | 2800 |  | 
|  | 2801 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 2802 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 2803 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 2804 | 0 \ | 
|  | 2805 | -c "Read from server: .* bytes read" | 
|  | 2806 |  | 
|  | 2807 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 2808 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 2809 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 2810 | 0 \ | 
|  | 2811 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 2812 |  | 
|  | 2813 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 2814 | # During session resumption, the client will send its ApplicationData record | 
|  | 2815 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 2816 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 2817 | # because the ApplicationData request has already been queued internally. | 
|  | 2818 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 2819 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 2820 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 2821 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 2822 | 0 \ | 
|  | 2823 | -c "Read from server: .* bytes read" | 
|  | 2824 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2825 | # Tests for version negotiation | 
|  | 2826 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2827 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2828 | "$P_SRV" \ | 
|  | 2829 | "$P_CLI" \ | 
|  | 2830 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2831 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2832 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2833 | -s "Protocol is TLSv1.2" \ | 
|  | 2834 | -c "Protocol is TLSv1.2" | 
|  | 2835 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2836 | run_test    "Version check: cli max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2837 | "$P_SRV" \ | 
|  | 2838 | "$P_CLI max_version=tls1_1" \ | 
|  | 2839 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2840 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2841 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2842 | -s "Protocol is TLSv1.1" \ | 
|  | 2843 | -c "Protocol is TLSv1.1" | 
|  | 2844 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2845 | run_test    "Version check: srv max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2846 | "$P_SRV max_version=tls1_1" \ | 
|  | 2847 | "$P_CLI" \ | 
|  | 2848 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2849 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2850 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2851 | -s "Protocol is TLSv1.1" \ | 
|  | 2852 | -c "Protocol is TLSv1.1" | 
|  | 2853 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2854 | 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] | 2855 | "$P_SRV max_version=tls1_1" \ | 
|  | 2856 | "$P_CLI max_version=tls1_1" \ | 
|  | 2857 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2858 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2859 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2860 | -s "Protocol is TLSv1.1" \ | 
|  | 2861 | -c "Protocol is TLSv1.1" | 
|  | 2862 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2863 | 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] | 2864 | "$P_SRV min_version=tls1_1" \ | 
|  | 2865 | "$P_CLI max_version=tls1_1" \ | 
|  | 2866 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2867 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2868 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2869 | -s "Protocol is TLSv1.1" \ | 
|  | 2870 | -c "Protocol is TLSv1.1" | 
|  | 2871 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2872 | 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] | 2873 | "$P_SRV max_version=tls1_1" \ | 
|  | 2874 | "$P_CLI min_version=tls1_1" \ | 
|  | 2875 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2876 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2877 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2878 | -s "Protocol is TLSv1.1" \ | 
|  | 2879 | -c "Protocol is TLSv1.1" | 
|  | 2880 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2881 | 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] | 2882 | "$P_SRV max_version=tls1_1" \ | 
|  | 2883 | "$P_CLI min_version=tls1_2" \ | 
|  | 2884 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2885 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2886 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2887 | -c "SSL - Handshake protocol not within min/max boundaries" | 
|  | 2888 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2889 | 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] | 2890 | "$P_SRV min_version=tls1_2" \ | 
|  | 2891 | "$P_CLI max_version=tls1_1" \ | 
|  | 2892 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2893 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2894 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2895 | -s "SSL - Handshake protocol not within min/max boundaries" | 
|  | 2896 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2897 | # Tests for ALPN extension | 
|  | 2898 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2899 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2900 | "$P_SRV debug_level=3" \ | 
|  | 2901 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2902 | 0 \ | 
|  | 2903 | -C "client hello, adding alpn extension" \ | 
|  | 2904 | -S "found alpn extension" \ | 
|  | 2905 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2906 | -S "server hello, adding alpn extension" \ | 
|  | 2907 | -C "found alpn extension " \ | 
|  | 2908 | -C "Application Layer Protocol is" \ | 
|  | 2909 | -S "Application Layer Protocol is" | 
|  | 2910 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2911 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2912 | "$P_SRV debug_level=3" \ | 
|  | 2913 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2914 | 0 \ | 
|  | 2915 | -c "client hello, adding alpn extension" \ | 
|  | 2916 | -s "found alpn extension" \ | 
|  | 2917 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2918 | -S "server hello, adding alpn extension" \ | 
|  | 2919 | -C "found alpn extension " \ | 
|  | 2920 | -c "Application Layer Protocol is (none)" \ | 
|  | 2921 | -S "Application Layer Protocol is" | 
|  | 2922 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2923 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2924 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2925 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2926 | 0 \ | 
|  | 2927 | -C "client hello, adding alpn extension" \ | 
|  | 2928 | -S "found alpn extension" \ | 
|  | 2929 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2930 | -S "server hello, adding alpn extension" \ | 
|  | 2931 | -C "found alpn extension " \ | 
|  | 2932 | -C "Application Layer Protocol is" \ | 
|  | 2933 | -s "Application Layer Protocol is (none)" | 
|  | 2934 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2935 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2936 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2937 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2938 | 0 \ | 
|  | 2939 | -c "client hello, adding alpn extension" \ | 
|  | 2940 | -s "found alpn extension" \ | 
|  | 2941 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2942 | -s "server hello, adding alpn extension" \ | 
|  | 2943 | -c "found alpn extension" \ | 
|  | 2944 | -c "Application Layer Protocol is abc" \ | 
|  | 2945 | -s "Application Layer Protocol is abc" | 
|  | 2946 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2947 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2948 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2949 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2950 | 0 \ | 
|  | 2951 | -c "client hello, adding alpn extension" \ | 
|  | 2952 | -s "found alpn extension" \ | 
|  | 2953 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2954 | -s "server hello, adding alpn extension" \ | 
|  | 2955 | -c "found alpn extension" \ | 
|  | 2956 | -c "Application Layer Protocol is abc" \ | 
|  | 2957 | -s "Application Layer Protocol is abc" | 
|  | 2958 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2959 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2960 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2961 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2962 | 0 \ | 
|  | 2963 | -c "client hello, adding alpn extension" \ | 
|  | 2964 | -s "found alpn extension" \ | 
|  | 2965 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2966 | -s "server hello, adding alpn extension" \ | 
|  | 2967 | -c "found alpn extension" \ | 
|  | 2968 | -c "Application Layer Protocol is 1234" \ | 
|  | 2969 | -s "Application Layer Protocol is 1234" | 
|  | 2970 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2971 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2972 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 2973 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2974 | 1 \ | 
|  | 2975 | -c "client hello, adding alpn extension" \ | 
|  | 2976 | -s "found alpn extension" \ | 
|  | 2977 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 2978 | -S "server hello, adding alpn extension" \ | 
|  | 2979 | -C "found alpn extension" \ | 
|  | 2980 | -C "Application Layer Protocol is 1234" \ | 
|  | 2981 | -S "Application Layer Protocol is 1234" | 
|  | 2982 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2983 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2984 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 2985 | # server-side certificate/suite selection | 
|  | 2986 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2987 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2988 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 2989 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 2990 | "$P_CLI" \ | 
|  | 2991 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2992 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2993 |  | 
|  | 2994 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2995 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2996 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 2997 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 2998 | "$P_CLI" \ | 
|  | 2999 | 0 \ | 
|  | 3000 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 3001 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3002 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3003 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3004 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3005 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3006 | 1 \ | 
|  | 3007 | -C "Ciphersuite is " | 
|  | 3008 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3009 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3010 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3011 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 3012 | "$P_CLI" \ | 
|  | 3013 | 0 \ | 
|  | 3014 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 3015 |  | 
|  | 3016 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3017 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3018 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3019 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3020 | "$P_CLI" \ | 
|  | 3021 | 0 \ | 
|  | 3022 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 3023 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3024 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3025 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3026 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3027 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3028 | 1 \ | 
|  | 3029 | -C "Ciphersuite is " | 
|  | 3030 |  | 
|  | 3031 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3032 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3033 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3034 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3035 | "$O_SRV -key data_files/server2.key \ | 
|  | 3036 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3037 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3038 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3039 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3040 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3041 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3042 | -c "Ciphersuite is TLS-" | 
|  | 3043 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3044 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3045 | "$O_SRV -key data_files/server2.key \ | 
|  | 3046 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3047 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3048 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3049 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3050 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3051 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3052 | -c "Ciphersuite is TLS-" | 
|  | 3053 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3054 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3055 | "$O_SRV -key data_files/server2.key \ | 
|  | 3056 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3057 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3058 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3059 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3060 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3061 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3062 | -c "Ciphersuite is TLS-" | 
|  | 3063 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3064 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3065 | "$O_SRV -key data_files/server2.key \ | 
|  | 3066 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3067 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3068 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3069 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3070 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3071 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3072 | -C "Ciphersuite is TLS-" | 
|  | 3073 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3074 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 3075 | "$O_SRV -key data_files/server2.key \ | 
|  | 3076 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3077 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 3078 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3079 | 0 \ | 
|  | 3080 | -c "bad certificate (usage extensions)" \ | 
|  | 3081 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3082 | -c "Ciphersuite is TLS-" \ | 
|  | 3083 | -c "! Usage does not match the keyUsage extension" | 
|  | 3084 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3085 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3086 | "$O_SRV -key data_files/server2.key \ | 
|  | 3087 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3088 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3089 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3090 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3091 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3092 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3093 | -c "Ciphersuite is TLS-" | 
|  | 3094 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3095 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3096 | "$O_SRV -key data_files/server2.key \ | 
|  | 3097 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3098 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3099 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3100 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3101 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3102 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3103 | -C "Ciphersuite is TLS-" | 
|  | 3104 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3105 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 3106 | "$O_SRV -key data_files/server2.key \ | 
|  | 3107 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 3108 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 3109 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3110 | 0 \ | 
|  | 3111 | -c "bad certificate (usage extensions)" \ | 
|  | 3112 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3113 | -c "Ciphersuite is TLS-" \ | 
|  | 3114 | -c "! Usage does not match the keyUsage extension" | 
|  | 3115 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3116 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 3117 | # server-side checking of client cert | 
|  | 3118 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3119 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3120 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3121 | "$O_CLI -key data_files/server2.key \ | 
|  | 3122 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 3123 | 0 \ | 
|  | 3124 | -S "bad certificate (usage extensions)" \ | 
|  | 3125 | -S "Processing of the Certificate handshake message failed" | 
|  | 3126 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3127 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3128 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3129 | "$O_CLI -key data_files/server2.key \ | 
|  | 3130 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3131 | 0 \ | 
|  | 3132 | -s "bad certificate (usage extensions)" \ | 
|  | 3133 | -S "Processing of the Certificate handshake message failed" | 
|  | 3134 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3135 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3136 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3137 | "$O_CLI -key data_files/server2.key \ | 
|  | 3138 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3139 | 1 \ | 
|  | 3140 | -s "bad certificate (usage extensions)" \ | 
|  | 3141 | -s "Processing of the Certificate handshake message failed" | 
|  | 3142 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3143 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3144 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3145 | "$O_CLI -key data_files/server5.key \ | 
|  | 3146 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 3147 | 0 \ | 
|  | 3148 | -S "bad certificate (usage extensions)" \ | 
|  | 3149 | -S "Processing of the Certificate handshake message failed" | 
|  | 3150 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3151 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3152 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3153 | "$O_CLI -key data_files/server5.key \ | 
|  | 3154 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 3155 | 0 \ | 
|  | 3156 | -s "bad certificate (usage extensions)" \ | 
|  | 3157 | -S "Processing of the Certificate handshake message failed" | 
|  | 3158 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3159 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 3160 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3161 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3162 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3163 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 3164 | "$P_CLI" \ | 
|  | 3165 | 0 | 
|  | 3166 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3167 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3168 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3169 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 3170 | "$P_CLI" \ | 
|  | 3171 | 0 | 
|  | 3172 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3173 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3174 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3175 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 3176 | "$P_CLI" \ | 
|  | 3177 | 0 | 
|  | 3178 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3179 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3180 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3181 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3182 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3183 | 1 | 
|  | 3184 |  | 
|  | 3185 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 3186 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3187 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3188 | "$O_SRV -key data_files/server5.key \ | 
|  | 3189 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3190 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3191 | 0 \ | 
|  | 3192 | -C "bad certificate (usage extensions)" \ | 
|  | 3193 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3194 | -c "Ciphersuite is TLS-" | 
|  | 3195 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3196 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3197 | "$O_SRV -key data_files/server5.key \ | 
|  | 3198 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3199 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3200 | 0 \ | 
|  | 3201 | -C "bad certificate (usage extensions)" \ | 
|  | 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    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3206 | "$O_SRV -key data_files/server5.key \ | 
|  | 3207 | -cert data_files/server5.eku-cs_any.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 | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3209 | 0 \ | 
|  | 3210 | -C "bad certificate (usage extensions)" \ | 
|  | 3211 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3212 | -c "Ciphersuite is TLS-" | 
|  | 3213 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3214 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3215 | "$O_SRV -key data_files/server5.key \ | 
|  | 3216 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3217 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3218 | 1 \ | 
|  | 3219 | -c "bad certificate (usage extensions)" \ | 
|  | 3220 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3221 | -C "Ciphersuite is TLS-" | 
|  | 3222 |  | 
|  | 3223 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 3224 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3225 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3226 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3227 | "$O_CLI -key data_files/server5.key \ | 
|  | 3228 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 3229 | 0 \ | 
|  | 3230 | -S "bad certificate (usage extensions)" \ | 
|  | 3231 | -S "Processing of the Certificate handshake message failed" | 
|  | 3232 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3233 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3234 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3235 | "$O_CLI -key data_files/server5.key \ | 
|  | 3236 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 3237 | 0 \ | 
|  | 3238 | -S "bad certificate (usage extensions)" \ | 
|  | 3239 | -S "Processing of the Certificate handshake message failed" | 
|  | 3240 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3241 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3242 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3243 | "$O_CLI -key data_files/server5.key \ | 
|  | 3244 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 3245 | 0 \ | 
|  | 3246 | -S "bad certificate (usage extensions)" \ | 
|  | 3247 | -S "Processing of the Certificate handshake message failed" | 
|  | 3248 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3249 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3250 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3251 | "$O_CLI -key data_files/server5.key \ | 
|  | 3252 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 3253 | 0 \ | 
|  | 3254 | -s "bad certificate (usage extensions)" \ | 
|  | 3255 | -S "Processing of the Certificate handshake message failed" | 
|  | 3256 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3257 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3258 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3259 | "$O_CLI -key data_files/server5.key \ | 
|  | 3260 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 3261 | 1 \ | 
|  | 3262 | -s "bad certificate (usage extensions)" \ | 
|  | 3263 | -s "Processing of the Certificate handshake message failed" | 
|  | 3264 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3265 | # Tests for DHM parameters loading | 
|  | 3266 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3267 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3268 | "$P_SRV" \ | 
|  | 3269 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3270 | debug_level=3" \ | 
|  | 3271 | 0 \ | 
|  | 3272 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3273 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3274 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3275 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3276 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 3277 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3278 | debug_level=3" \ | 
|  | 3279 | 0 \ | 
|  | 3280 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 3281 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 3282 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3283 | # Tests for DHM client-side size checking | 
|  | 3284 |  | 
|  | 3285 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 3286 | "$P_SRV" \ | 
|  | 3287 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3288 | debug_level=1" \ | 
|  | 3289 | 0 \ | 
|  | 3290 | -C "DHM prime too short:" | 
|  | 3291 |  | 
|  | 3292 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 3293 | "$P_SRV" \ | 
|  | 3294 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3295 | debug_level=1 dhmlen=2048" \ | 
|  | 3296 | 0 \ | 
|  | 3297 | -C "DHM prime too short:" | 
|  | 3298 |  | 
|  | 3299 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 3300 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 3301 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3302 | debug_level=1" \ | 
|  | 3303 | 0 \ | 
|  | 3304 | -C "DHM prime too short:" | 
|  | 3305 |  | 
|  | 3306 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 3307 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 3308 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3309 | debug_level=1" \ | 
|  | 3310 | 1 \ | 
|  | 3311 | -c "DHM prime too short:" | 
|  | 3312 |  | 
|  | 3313 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 3314 | "$P_SRV" \ | 
|  | 3315 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3316 | debug_level=1 dhmlen=2049" \ | 
|  | 3317 | 1 \ | 
|  | 3318 | -c "DHM prime too short:" | 
|  | 3319 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3320 | # Tests for PSK callback | 
|  | 3321 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3322 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3323 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 3324 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3325 | psk_identity=foo psk=abc123" \ | 
|  | 3326 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3327 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3328 | -S "SSL - Unknown identity received" \ | 
|  | 3329 | -S "SSL - Verification of the message MAC failed" | 
|  | 3330 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3331 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3332 | "$P_SRV" \ | 
|  | 3333 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3334 | psk_identity=foo psk=abc123" \ | 
|  | 3335 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3336 | -s "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3337 | -S "SSL - Unknown identity received" \ | 
|  | 3338 | -S "SSL - Verification of the message MAC failed" | 
|  | 3339 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3340 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3341 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 3342 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3343 | psk_identity=foo psk=abc123" \ | 
|  | 3344 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3345 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3346 | -s "SSL - Unknown identity received" \ | 
|  | 3347 | -S "SSL - Verification of the message MAC failed" | 
|  | 3348 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3349 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3350 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3351 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3352 | psk_identity=abc psk=dead" \ | 
|  | 3353 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3354 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3355 | -S "SSL - Unknown identity received" \ | 
|  | 3356 | -S "SSL - Verification of the message MAC failed" | 
|  | 3357 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3358 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3359 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3360 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3361 | psk_identity=def psk=beef" \ | 
|  | 3362 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3363 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3364 | -S "SSL - Unknown identity received" \ | 
|  | 3365 | -S "SSL - Verification of the message MAC failed" | 
|  | 3366 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3367 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3368 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3369 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3370 | psk_identity=ghi psk=beef" \ | 
|  | 3371 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3372 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3373 | -s "SSL - Unknown identity received" \ | 
|  | 3374 | -S "SSL - Verification of the message MAC failed" | 
|  | 3375 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3376 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3377 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3378 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3379 | psk_identity=abc psk=beef" \ | 
|  | 3380 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3381 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3382 | -S "SSL - Unknown identity received" \ | 
|  | 3383 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3384 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3385 | # Tests for EC J-PAKE | 
|  | 3386 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3387 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3388 | run_test    "ECJPAKE: client not configured" \ | 
|  | 3389 | "$P_SRV debug_level=3" \ | 
|  | 3390 | "$P_CLI debug_level=3" \ | 
|  | 3391 | 0 \ | 
|  | 3392 | -C "add ciphersuite: c0ff" \ | 
|  | 3393 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3394 | -S "found ecjpake kkpp extension" \ | 
|  | 3395 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3396 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3397 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3398 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3399 | -S "None of the common ciphersuites is usable" | 
|  | 3400 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3402 | run_test    "ECJPAKE: server not configured" \ | 
|  | 3403 | "$P_SRV debug_level=3" \ | 
|  | 3404 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3405 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3406 | 1 \ | 
|  | 3407 | -c "add ciphersuite: c0ff" \ | 
|  | 3408 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3409 | -s "found ecjpake kkpp extension" \ | 
|  | 3410 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3411 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3412 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3413 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3414 | -s "None of the common ciphersuites is usable" | 
|  | 3415 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3417 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 3418 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3419 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3420 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3421 | 0 \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3422 | -c "add ciphersuite: c0ff" \ | 
|  | 3423 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3424 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3425 | -s "found ecjpake kkpp extension" \ | 
|  | 3426 | -S "skip ecjpake kkpp extension" \ | 
|  | 3427 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3428 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3429 | -c "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3430 | -S "None of the common ciphersuites is usable" \ | 
|  | 3431 | -S "SSL - Verification of the message MAC failed" | 
|  | 3432 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3433 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3435 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 3436 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3437 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 3438 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3439 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3440 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3441 | -s "SSL - Verification of the message MAC failed" | 
|  | 3442 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3444 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 3445 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3446 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3447 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3448 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3449 | -c "re-using cached ecjpake parameters" \ | 
|  | 3450 | -S "SSL - Verification of the message MAC failed" | 
|  | 3451 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3453 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 3454 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 3455 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3456 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3457 | 0 \ | 
|  | 3458 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3459 | -S "SSL - Verification of the message MAC failed" | 
|  | 3460 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3461 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3463 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 3464 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3465 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 3466 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3467 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3468 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3469 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3470 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3471 | # for tests with configs/config-thread.h | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3473 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 3474 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 3475 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 3476 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3477 | 0 | 
|  | 3478 |  | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3479 | # Tests for ciphersuites per version | 
|  | 3480 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3481 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3482 | run_test    "Per-version suites: SSL3" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3483 | "$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] | 3484 | "$P_CLI force_version=ssl3" \ | 
|  | 3485 | 0 \ | 
|  | 3486 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" | 
|  | 3487 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3488 | run_test    "Per-version suites: TLS 1.0" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3489 | "$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] | 3490 | "$P_CLI force_version=tls1 arc4=1" \ | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3491 | 0 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3492 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3493 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3494 | run_test    "Per-version suites: TLS 1.1" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3495 | "$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] | 3496 | "$P_CLI force_version=tls1_1" \ | 
|  | 3497 | 0 \ | 
|  | 3498 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" | 
|  | 3499 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3500 | run_test    "Per-version suites: TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3501 | "$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] | 3502 | "$P_CLI force_version=tls1_2" \ | 
|  | 3503 | 0 \ | 
|  | 3504 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" | 
|  | 3505 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3506 | # Test for ClientHello without extensions | 
|  | 3507 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3508 | requires_gnutls | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3509 | run_test    "ClientHello without extensions, SHA-1 allowed" \ | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3510 | "$P_SRV debug_level=3" \ | 
|  | 3511 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3512 | 0 \ | 
|  | 3513 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3514 |  | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3515 | requires_gnutls | 
|  | 3516 | run_test    "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ | 
|  | 3517 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ | 
|  | 3518 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3519 | 0 \ | 
|  | 3520 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3521 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3522 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3523 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3524 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3525 | "$P_SRV" \ | 
|  | 3526 | "$P_CLI request_size=100" \ | 
|  | 3527 | 0 \ | 
|  | 3528 | -s "Read from client: 100 bytes read$" | 
|  | 3529 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3530 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3531 | "$P_SRV" \ | 
|  | 3532 | "$P_CLI request_size=500" \ | 
|  | 3533 | 0 \ | 
|  | 3534 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3535 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3536 | # Tests for small packets | 
|  | 3537 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3539 | run_test    "Small packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3540 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3541 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3543 | 0 \ | 
|  | 3544 | -s "Read from client: 1 bytes read" | 
|  | 3545 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3546 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3547 | run_test    "Small packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3548 | "$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] | 3549 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3550 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3551 | 0 \ | 
|  | 3552 | -s "Read from client: 1 bytes read" | 
|  | 3553 |  | 
|  | 3554 | run_test    "Small packet TLS 1.0 BlockCipher" \ | 
|  | 3555 | "$P_SRV" \ | 
|  | 3556 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 3557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3558 | 0 \ | 
|  | 3559 | -s "Read from client: 1 bytes read" | 
|  | 3560 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3561 | run_test    "Small packet TLS 1.0 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3562 | "$P_SRV" \ | 
|  | 3563 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ | 
|  | 3564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3565 | 0 \ | 
|  | 3566 | -s "Read from client: 1 bytes read" | 
|  | 3567 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3569 | run_test    "Small packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3570 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3571 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3572 | 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] | 3573 | 0 \ | 
|  | 3574 | -s "Read from client: 1 bytes read" | 
|  | 3575 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3577 | run_test    "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3578 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3579 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3580 | 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] | 3581 | 0 \ | 
|  | 3582 | -s "Read from client: 1 bytes read" | 
|  | 3583 |  | 
|  | 3584 | run_test    "Small packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3585 | "$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] | 3586 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3587 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3588 | 0 \ | 
|  | 3589 | -s "Read from client: 1 bytes read" | 
|  | 3590 |  | 
|  | 3591 | run_test    "Small packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 3592 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3593 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3594 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3595 | 0 \ | 
|  | 3596 | -s "Read from client: 1 bytes read" | 
|  | 3597 |  | 
|  | 3598 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3599 | run_test    "Small packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3600 | "$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] | 3601 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3602 | 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] | 3603 | 0 \ | 
|  | 3604 | -s "Read from client: 1 bytes read" | 
|  | 3605 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3606 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3607 | run_test    "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3608 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 3609 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3610 | trunc_hmac=1 etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3611 | 0 \ | 
|  | 3612 | -s "Read from client: 1 bytes read" | 
|  | 3613 |  | 
|  | 3614 | run_test    "Small packet TLS 1.1 BlockCipher" \ | 
|  | 3615 | "$P_SRV" \ | 
|  | 3616 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3618 | 0 \ | 
|  | 3619 | -s "Read from client: 1 bytes read" | 
|  | 3620 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3621 | run_test    "Small packet TLS 1.1 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3622 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3623 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3625 | 0 \ | 
|  | 3626 | -s "Read from client: 1 bytes read" | 
|  | 3627 |  | 
|  | 3628 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3629 | run_test    "Small packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3630 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3631 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3633 | 0 \ | 
|  | 3634 | -s "Read from client: 1 bytes read" | 
|  | 3635 |  | 
|  | 3636 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3637 | run_test    "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3638 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3639 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3640 | 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] | 3641 | 0 \ | 
|  | 3642 | -s "Read from client: 1 bytes read" | 
|  | 3643 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3644 | run_test    "Small packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3645 | "$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] | 3646 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3648 | 0 \ | 
|  | 3649 | -s "Read from client: 1 bytes read" | 
|  | 3650 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3651 | run_test    "Small packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 3652 | "$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] | 3653 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3654 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3655 | 0 \ | 
|  | 3656 | -s "Read from client: 1 bytes read" | 
|  | 3657 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3658 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3659 | run_test    "Small packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3660 | "$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] | 3661 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3662 | 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] | 3663 | 0 \ | 
|  | 3664 | -s "Read from client: 1 bytes read" | 
|  | 3665 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3666 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3667 | run_test    "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3668 | "$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] | 3669 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3670 | 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] | 3671 | 0 \ | 
|  | 3672 | -s "Read from client: 1 bytes read" | 
|  | 3673 |  | 
|  | 3674 | run_test    "Small packet TLS 1.2 BlockCipher" \ | 
|  | 3675 | "$P_SRV" \ | 
|  | 3676 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3678 | 0 \ | 
|  | 3679 | -s "Read from client: 1 bytes read" | 
|  | 3680 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3681 | run_test    "Small packet TLS 1.2 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3682 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3683 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3684 | 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] | 3685 | 0 \ | 
|  | 3686 | -s "Read from client: 1 bytes read" | 
|  | 3687 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3688 | run_test    "Small packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 3689 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3690 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3691 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3692 | 0 \ | 
|  | 3693 | -s "Read from client: 1 bytes read" | 
|  | 3694 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3696 | run_test    "Small packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3697 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3698 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3699 | 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] | 3700 | 0 \ | 
|  | 3701 | -s "Read from client: 1 bytes read" | 
|  | 3702 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3704 | run_test    "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3705 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3706 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3707 | 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] | 3708 | 0 \ | 
|  | 3709 | -s "Read from client: 1 bytes read" | 
|  | 3710 |  | 
|  | 3711 | run_test    "Small packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3712 | "$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] | 3713 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3714 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3715 | 0 \ | 
|  | 3716 | -s "Read from client: 1 bytes read" | 
|  | 3717 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3718 | run_test    "Small packet TLS 1.2 StreamCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3719 | "$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] | 3720 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3721 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3722 | 0 \ | 
|  | 3723 | -s "Read from client: 1 bytes read" | 
|  | 3724 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3726 | run_test    "Small packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3727 | "$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] | 3728 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3729 | 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] | 3730 | 0 \ | 
|  | 3731 | -s "Read from client: 1 bytes read" | 
|  | 3732 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3734 | run_test    "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3735 | "$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] | 3736 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3737 | 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] | 3738 | 0 \ | 
|  | 3739 | -s "Read from client: 1 bytes read" | 
|  | 3740 |  | 
|  | 3741 | run_test    "Small packet TLS 1.2 AEAD" \ | 
|  | 3742 | "$P_SRV" \ | 
|  | 3743 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 3745 | 0 \ | 
|  | 3746 | -s "Read from client: 1 bytes read" | 
|  | 3747 |  | 
|  | 3748 | run_test    "Small packet TLS 1.2 AEAD shorter tag" \ | 
|  | 3749 | "$P_SRV" \ | 
|  | 3750 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 3752 | 0 \ | 
|  | 3753 | -s "Read from client: 1 bytes read" | 
|  | 3754 |  | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3755 | # Tests for small packets in DTLS | 
|  | 3756 |  | 
|  | 3757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3758 | run_test    "Small packet DTLS 1.0" \ | 
|  | 3759 | "$P_SRV dtls=1 force_version=dtls1" \ | 
|  | 3760 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 3761 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3762 | 0 \ | 
|  | 3763 | -s "Read from client: 1 bytes read" | 
|  | 3764 |  | 
|  | 3765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3766 | run_test    "Small packet DTLS 1.0, without EtM" \ | 
|  | 3767 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ | 
|  | 3768 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 3769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3770 | 0 \ | 
|  | 3771 | -s "Read from client: 1 bytes read" | 
|  | 3772 |  | 
|  | 3773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3775 | run_test    "Small packet DTLS 1.0, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3776 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 3777 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3779 | 0 \ | 
|  | 3780 | -s "Read from client: 1 bytes read" | 
|  | 3781 |  | 
|  | 3782 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3783 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3784 | run_test    "Small packet DTLS 1.0, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3785 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3786 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3788 | 0 \ | 
|  | 3789 | -s "Read from client: 1 bytes read" | 
|  | 3790 |  | 
|  | 3791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3792 | run_test    "Small packet DTLS 1.2" \ | 
|  | 3793 | "$P_SRV dtls=1 force_version=dtls1_2" \ | 
|  | 3794 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 3795 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3796 | 0 \ | 
|  | 3797 | -s "Read from client: 1 bytes read" | 
|  | 3798 |  | 
|  | 3799 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3800 | run_test    "Small packet DTLS 1.2, without EtM" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3801 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3802 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 3803 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3804 | 0 \ | 
|  | 3805 | -s "Read from client: 1 bytes read" | 
|  | 3806 |  | 
|  | 3807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3808 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3809 | run_test    "Small packet DTLS 1.2, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3810 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3811 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3812 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3813 | 0 \ | 
|  | 3814 | -s "Read from client: 1 bytes read" | 
|  | 3815 |  | 
|  | 3816 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 3817 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3818 | run_test    "Small packet DTLS 1.2, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3819 | "$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] | 3820 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3821 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3822 | 0 \ | 
|  | 3823 | -s "Read from client: 1 bytes read" | 
|  | 3824 |  | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 3825 | # A test for extensions in SSLv3 | 
|  | 3826 |  | 
|  | 3827 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 3828 | run_test    "SSLv3 with extensions, server side" \ | 
|  | 3829 | "$P_SRV min_version=ssl3 debug_level=3" \ | 
|  | 3830 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ | 
|  | 3831 | 0 \ | 
|  | 3832 | -S "dumping 'client hello extensions'" \ | 
|  | 3833 | -S "server hello, total extension length:" | 
|  | 3834 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3835 | # Test for large packets | 
|  | 3836 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3837 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3838 | run_test    "Large packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3839 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3840 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3841 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3842 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3843 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3844 | -s "Read from client: 16384 bytes read" | 
|  | 3845 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3846 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3847 | run_test    "Large packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3848 | "$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] | 3849 | "$P_CLI request_size=16384 force_version=ssl3 \ | 
|  | 3850 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3851 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3852 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3853 | -s "Read from client: 16384 bytes read" | 
|  | 3854 |  | 
|  | 3855 | run_test    "Large packet TLS 1.0 BlockCipher" \ | 
|  | 3856 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3857 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3858 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3859 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3860 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3861 | -s "Read from client: 16384 bytes read" | 
|  | 3862 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3863 | run_test    "Large packet TLS 1.0 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3864 | "$P_SRV" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3865 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
|  | 3866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3867 | 0 \ | 
|  | 3868 | -s "Read from client: 16384 bytes read" | 
|  | 3869 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3871 | run_test    "Large packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3872 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3873 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3874 | 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] | 3875 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3876 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3877 | -s "Read from client: 16384 bytes read" | 
|  | 3878 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3879 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3880 | run_test    "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3881 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3882 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3883 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3884 | 0 \ | 
|  | 3885 | -s "Read from client: 16384 bytes read" | 
|  | 3886 |  | 
|  | 3887 | run_test    "Large packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3888 | "$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] | 3889 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3890 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3891 | 0 \ | 
|  | 3892 | -s "Read from client: 16384 bytes read" | 
|  | 3893 |  | 
|  | 3894 | run_test    "Large packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 3895 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3896 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3897 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3898 | 0 \ | 
|  | 3899 | -s "Read from client: 16384 bytes read" | 
|  | 3900 |  | 
|  | 3901 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3902 | run_test    "Large packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3903 | "$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] | 3904 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3905 | 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] | 3906 | 0 \ | 
|  | 3907 | -s "Read from client: 16384 bytes read" | 
|  | 3908 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3909 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3910 | run_test    "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3911 | "$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] | 3912 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3913 | 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] | 3914 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3915 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3916 | -s "Read from client: 16384 bytes read" | 
|  | 3917 |  | 
|  | 3918 | run_test    "Large packet TLS 1.1 BlockCipher" \ | 
|  | 3919 | "$P_SRV" \ | 
|  | 3920 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3921 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3922 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3923 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3924 | -s "Read from client: 16384 bytes read" | 
|  | 3925 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3926 | run_test    "Large packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 3927 | "$P_SRV" \ | 
|  | 3928 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ | 
|  | 3929 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3930 | 0 \ | 
|  | 3931 | -s "Read from client: 16384 bytes read" | 
|  | 3932 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3933 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3934 | run_test    "Large packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3935 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3936 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3937 | 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] | 3938 | 0 \ | 
|  | 3939 | -s "Read from client: 16384 bytes read" | 
|  | 3940 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3941 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3942 | run_test    "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3943 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3944 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3945 | 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] | 3946 | 0 \ | 
|  | 3947 | -s "Read from client: 16384 bytes read" | 
|  | 3948 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3949 | run_test    "Large packet TLS 1.1 StreamCipher" \ | 
|  | 3950 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3951 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3952 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3953 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3954 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3955 | -s "Read from client: 16384 bytes read" | 
|  | 3956 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3957 | run_test    "Large packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 3958 | "$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] | 3959 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3960 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3961 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3962 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3963 | -s "Read from client: 16384 bytes read" | 
|  | 3964 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3965 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3966 | run_test    "Large packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3967 | "$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] | 3968 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3969 | 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] | 3970 | 0 \ | 
|  | 3971 | -s "Read from client: 16384 bytes read" | 
|  | 3972 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3973 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3974 | run_test    "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3975 | "$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] | 3976 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3977 | 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] | 3978 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3979 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3980 | -s "Read from client: 16384 bytes read" | 
|  | 3981 |  | 
|  | 3982 | run_test    "Large packet TLS 1.2 BlockCipher" \ | 
|  | 3983 | "$P_SRV" \ | 
|  | 3984 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3985 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3986 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 3987 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3988 | -s "Read from client: 16384 bytes read" | 
|  | 3989 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 3990 | run_test    "Large packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 3991 | "$P_SRV" \ | 
|  | 3992 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ | 
|  | 3993 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3994 | 0 \ | 
|  | 3995 | -s "Read from client: 16384 bytes read" | 
|  | 3996 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3997 | run_test    "Large packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 3998 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3999 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4000 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4001 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4002 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4003 | -s "Read from client: 16384 bytes read" | 
|  | 4004 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4005 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4006 | run_test    "Large packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4007 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4008 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4009 | 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] | 4010 | 0 \ | 
|  | 4011 | -s "Read from client: 16384 bytes read" | 
|  | 4012 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4013 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4014 | run_test    "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4015 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4016 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4017 | 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] | 4018 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4019 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4020 | -s "Read from client: 16384 bytes read" | 
|  | 4021 |  | 
|  | 4022 | run_test    "Large packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4023 | "$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] | 4024 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4025 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4026 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4027 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4028 | -s "Read from client: 16384 bytes read" | 
|  | 4029 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4030 | run_test    "Large packet TLS 1.2 StreamCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4031 | "$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] | 4032 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4033 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 4034 | 0 \ | 
|  | 4035 | -s "Read from client: 16384 bytes read" | 
|  | 4036 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4038 | run_test    "Large packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4039 | "$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] | 4040 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4041 | 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] | 4042 | 0 \ | 
|  | 4043 | -s "Read from client: 16384 bytes read" | 
|  | 4044 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4045 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4046 | run_test    "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4047 | "$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] | 4048 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4049 | 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] | 4050 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4051 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4052 | -s "Read from client: 16384 bytes read" | 
|  | 4053 |  | 
|  | 4054 | run_test    "Large packet TLS 1.2 AEAD" \ | 
|  | 4055 | "$P_SRV" \ | 
|  | 4056 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4057 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 4058 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4059 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4060 | -s "Read from client: 16384 bytes read" | 
|  | 4061 |  | 
|  | 4062 | run_test    "Large packet TLS 1.2 AEAD shorter tag" \ | 
|  | 4063 | "$P_SRV" \ | 
|  | 4064 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4065 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 4066 | 0 \ | 
| Hanno Becker | 09930d1 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4067 | -c "16384 bytes written in 1 fragments" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4068 | -s "Read from client: 16384 bytes read" | 
|  | 4069 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4070 | # Tests of asynchronous private key support in SSL | 
|  | 4071 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4072 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4073 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 4074 | "$P_SRV \ | 
|  | 4075 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4076 | "$P_CLI" \ | 
|  | 4077 | 0 \ | 
|  | 4078 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4079 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4080 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4081 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4082 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 4083 | "$P_SRV \ | 
|  | 4084 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4085 | "$P_CLI" \ | 
|  | 4086 | 0 \ | 
|  | 4087 | -s "Async sign callback: using key slot " \ | 
|  | 4088 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4089 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4090 |  | 
| Gilles Peskine | 37d4175 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4091 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4092 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 4093 | "$P_SRV \ | 
|  | 4094 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 4095 | "$P_CLI" \ | 
|  | 4096 | 0 \ | 
|  | 4097 | -s "Async sign callback: using key slot " \ | 
|  | 4098 | -U "Async sign callback: using key slot " \ | 
|  | 4099 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 4100 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4101 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4102 |  | 
| Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4103 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 | 
|  | 4104 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. | 
|  | 4105 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4106 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 4107 | run_test    "SSL async private: sign, RSA, TLS 1.1" \ | 
|  | 4108 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ | 
|  | 4109 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4110 | "$P_CLI force_version=tls1_1" \ | 
|  | 4111 | 0 \ | 
|  | 4112 | -s "Async sign callback: using key slot " \ | 
|  | 4113 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4114 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4115 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4116 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 4117 | "$P_SRV \ | 
|  | 4118 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4119 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4120 | 0 \ | 
|  | 4121 | -s "Async decrypt callback: using key slot " \ | 
|  | 4122 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4123 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4124 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4125 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 4126 | "$P_SRV \ | 
|  | 4127 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4128 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4129 | 0 \ | 
|  | 4130 | -s "Async decrypt callback: using key slot " \ | 
|  | 4131 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4132 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4133 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4134 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4135 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 4136 | "$P_SRV psk=abc123 \ | 
|  | 4137 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4138 | "$P_CLI psk=abc123 \ | 
|  | 4139 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 4140 | 0 \ | 
|  | 4141 | -s "Async decrypt callback: using key slot " \ | 
|  | 4142 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4143 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4145 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 4146 | "$P_SRV psk=abc123 \ | 
|  | 4147 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4148 | "$P_CLI psk=abc123 \ | 
|  | 4149 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 4150 | 0 \ | 
|  | 4151 | -s "Async decrypt callback: using key slot " \ | 
|  | 4152 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4153 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4154 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4155 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4156 | run_test    "SSL async private: sign callback not present" \ | 
|  | 4157 | "$P_SRV \ | 
|  | 4158 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4159 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 4160 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4161 | 0 \ | 
|  | 4162 | -S "Async sign callback" \ | 
|  | 4163 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4164 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 4165 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 4166 | -s "Successful connection" | 
|  | 4167 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4168 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4169 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 4170 | "$P_SRV debug_level=1 \ | 
|  | 4171 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4172 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 4173 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4174 | 0 \ | 
|  | 4175 | -S "Async decrypt callback" \ | 
|  | 4176 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4177 | -s "got no RSA private key" \ | 
|  | 4178 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 4179 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4180 |  | 
|  | 4181 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4182 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4183 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4184 | "$P_SRV \ | 
|  | 4185 | async_operations=s async_private_delay1=1 \ | 
|  | 4186 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4187 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4188 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4189 | 0 \ | 
|  | 4190 | -s "Async sign callback: using key slot 0," \ | 
|  | 4191 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4192 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4193 |  | 
|  | 4194 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4195 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4196 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4197 | "$P_SRV \ | 
|  | 4198 | async_operations=s async_private_delay2=1 \ | 
|  | 4199 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4200 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4201 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4202 | 0 \ | 
|  | 4203 | -s "Async sign callback: using key slot 0," \ | 
|  | 4204 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4205 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4206 |  | 
|  | 4207 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4209 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4210 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4211 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4212 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4213 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4214 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4215 | 0 \ | 
|  | 4216 | -s "Async sign callback: using key slot 1," \ | 
|  | 4217 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4218 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4219 |  | 
|  | 4220 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4221 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4222 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4223 | "$P_SRV \ | 
|  | 4224 | async_operations=s async_private_delay1=1 \ | 
|  | 4225 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4226 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4227 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4228 | 0 \ | 
|  | 4229 | -s "Async sign callback: no key matches this certificate." | 
|  | 4230 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4231 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4232 | run_test    "SSL async private: error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4233 | "$P_SRV \ | 
|  | 4234 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4235 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4236 | "$P_CLI" \ | 
|  | 4237 | 1 \ | 
|  | 4238 | -s "Async sign callback: injected error" \ | 
|  | 4239 | -S "Async resume" \ | 
| Gilles Peskine | 20e2bdf | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4240 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4241 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4242 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4243 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4244 | run_test    "SSL async private: cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4245 | "$P_SRV \ | 
|  | 4246 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4247 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4248 | "$P_CLI" \ | 
|  | 4249 | 1 \ | 
|  | 4250 | -s "Async sign callback: using key slot " \ | 
|  | 4251 | -S "Async resume" \ | 
|  | 4252 | -s "Async cancel" | 
|  | 4253 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4255 | run_test    "SSL async private: error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4256 | "$P_SRV \ | 
|  | 4257 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4258 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4259 | "$P_CLI" \ | 
|  | 4260 | 1 \ | 
|  | 4261 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4262 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 20e2bdf | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4263 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4264 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4265 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4266 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4267 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4268 | "$P_SRV \ | 
|  | 4269 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4270 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4271 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4272 | 0 \ | 
|  | 4273 | -s "Async cancel" \ | 
|  | 4274 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4275 | -s "Async resume" \ | 
|  | 4276 | -s "Successful connection" | 
|  | 4277 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4278 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4279 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4280 | "$P_SRV \ | 
|  | 4281 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4282 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4283 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4284 | 0 \ | 
|  | 4285 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4286 | -s "Async resume" \ | 
|  | 4287 | -s "Successful connection" | 
|  | 4288 |  | 
|  | 4289 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4291 | 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] | 4292 | "$P_SRV \ | 
|  | 4293 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 4294 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4295 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4296 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 4297 | [ \$? -eq 1 ] && | 
|  | 4298 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4299 | 0 \ | 
| Gilles Peskine | 0798158 | 2018-04-30 10:02:45 +0200 | [diff] [blame^] | 4300 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4301 | -S "Async resume" \ | 
|  | 4302 | -s "Async cancel" \ | 
|  | 4303 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4304 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 4305 | -s "Successful connection" | 
|  | 4306 |  | 
|  | 4307 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4308 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4309 | run_test    "SSL async private: error in resume then fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4310 | "$P_SRV \ | 
|  | 4311 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 4312 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4313 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4314 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 4315 | [ \$? -eq 1 ] && | 
|  | 4316 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4317 | 0 \ | 
|  | 4318 | -s "Async resume" \ | 
|  | 4319 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4320 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 4321 | -s "Successful connection" | 
|  | 4322 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4324 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4325 | run_test    "SSL async private: renegotiation: client-initiated; sign" \ | 
|  | 4326 | "$P_SRV \ | 
|  | 4327 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4328 | exchanges=2 renegotiation=1" \ | 
|  | 4329 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4330 | 0 \ | 
|  | 4331 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4332 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4333 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4334 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4335 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4336 | run_test    "SSL async private: renegotiation: server-initiated; sign" \ | 
|  | 4337 | "$P_SRV \ | 
|  | 4338 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4339 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4340 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 4341 | 0 \ | 
|  | 4342 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4343 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4344 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 4347 | run_test    "SSL async private: renegotiation: client-initiated; decrypt" \ | 
|  | 4348 | "$P_SRV \ | 
|  | 4349 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4350 | exchanges=2 renegotiation=1" \ | 
|  | 4351 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 4352 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4353 | 0 \ | 
|  | 4354 | -s "Async decrypt callback: using key slot " \ | 
|  | 4355 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4356 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4357 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 4359 | run_test    "SSL async private: renegotiation: server-initiated; decrypt" \ | 
|  | 4360 | "$P_SRV \ | 
|  | 4361 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4362 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4363 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 4364 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4365 | 0 \ | 
|  | 4366 | -s "Async decrypt callback: using key slot " \ | 
|  | 4367 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4368 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4369 | # Tests for DTLS HelloVerifyRequest | 
|  | 4370 |  | 
|  | 4371 | run_test    "DTLS cookie: enabled" \ | 
|  | 4372 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4373 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4374 | 0 \ | 
|  | 4375 | -s "cookie verification failed" \ | 
|  | 4376 | -s "cookie verification passed" \ | 
|  | 4377 | -S "cookie verification skipped" \ | 
|  | 4378 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4379 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4380 | -S "SSL - The requested feature is not available" | 
|  | 4381 |  | 
|  | 4382 | run_test    "DTLS cookie: disabled" \ | 
|  | 4383 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 4384 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4385 | 0 \ | 
|  | 4386 | -S "cookie verification failed" \ | 
|  | 4387 | -S "cookie verification passed" \ | 
|  | 4388 | -s "cookie verification skipped" \ | 
|  | 4389 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4390 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4391 | -S "SSL - The requested feature is not available" | 
|  | 4392 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4393 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 4394 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 4395 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 4396 | 1 \ | 
|  | 4397 | -s "cookie verification failed" \ | 
|  | 4398 | -S "cookie verification passed" \ | 
|  | 4399 | -S "cookie verification skipped" \ | 
|  | 4400 | -C "received hello verify request" \ | 
|  | 4401 | -S "hello verification requested" \ | 
|  | 4402 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4403 |  | 
|  | 4404 | requires_ipv6 | 
|  | 4405 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 4406 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 4407 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 4408 | 0 \ | 
|  | 4409 | -s "cookie verification failed" \ | 
|  | 4410 | -s "cookie verification passed" \ | 
|  | 4411 | -S "cookie verification skipped" \ | 
|  | 4412 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4413 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4414 | -S "SSL - The requested feature is not available" | 
|  | 4415 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4416 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 4417 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 4418 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 4419 | 0 \ | 
|  | 4420 | -s "cookie verification failed" \ | 
|  | 4421 | -s "cookie verification passed" \ | 
|  | 4422 | -S "cookie verification skipped" \ | 
|  | 4423 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4424 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4425 | -S "SSL - The requested feature is not available" | 
|  | 4426 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4427 | # Tests for client reconnecting from the same port with DTLS | 
|  | 4428 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4429 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4430 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4431 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 4432 | "$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] | 4433 | 0 \ | 
|  | 4434 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4435 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4436 | -S "Client initiated reconnection from same port" | 
|  | 4437 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4438 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4439 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4440 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 4441 | "$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] | 4442 | 0 \ | 
|  | 4443 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4444 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4445 | -s "Client initiated reconnection from same port" | 
|  | 4446 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4447 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 4448 | 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] | 4449 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 4450 | "$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] | 4451 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4452 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4453 | -s "Client initiated reconnection from same port" | 
|  | 4454 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4455 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 4456 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 4457 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 4458 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 4459 | 0 \ | 
|  | 4460 | -S "The operation timed out" \ | 
|  | 4461 | -s "Client initiated reconnection from same port" | 
|  | 4462 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4463 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 4464 | "$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] | 4465 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 4466 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4467 | -s "The operation timed out" \ | 
|  | 4468 | -S "Client initiated reconnection from same port" | 
|  | 4469 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4470 | # Tests for various cases of client authentication with DTLS | 
|  | 4471 | # (focused on handshake flows and message parsing) | 
|  | 4472 |  | 
|  | 4473 | run_test    "DTLS client auth: required" \ | 
|  | 4474 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 4475 | "$P_CLI dtls=1" \ | 
|  | 4476 | 0 \ | 
|  | 4477 | -s "Verifying peer X.509 certificate... ok" | 
|  | 4478 |  | 
|  | 4479 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 4480 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 4481 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 4482 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4483 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4484 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4485 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4486 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 4487 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 4488 | 0 \ | 
|  | 4489 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4490 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4491 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4492 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 4493 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 4494 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 4495 | 1 \ | 
|  | 4496 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 4497 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 4498 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4499 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 4500 |  | 
|  | 4501 | requires_gnutls | 
|  | 4502 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 4503 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 4504 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4505 | 0 \ | 
|  | 4506 | -C "found fragmented DTLS handshake message" \ | 
|  | 4507 | -C "error" | 
|  | 4508 |  | 
|  | 4509 | requires_gnutls | 
|  | 4510 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 4511 | "$G_SRV -u --mtu 512" \ | 
|  | 4512 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4513 | 0 \ | 
|  | 4514 | -c "found fragmented DTLS handshake message" \ | 
|  | 4515 | -C "error" | 
|  | 4516 |  | 
|  | 4517 | requires_gnutls | 
|  | 4518 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 4519 | "$G_SRV -u --mtu 128" \ | 
|  | 4520 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4521 | 0 \ | 
|  | 4522 | -c "found fragmented DTLS handshake message" \ | 
|  | 4523 | -C "error" | 
|  | 4524 |  | 
|  | 4525 | requires_gnutls | 
|  | 4526 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 4527 | "$G_SRV -u --mtu 128" \ | 
|  | 4528 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 4529 | 0 \ | 
|  | 4530 | -c "found fragmented DTLS handshake message" \ | 
|  | 4531 | -C "error" | 
|  | 4532 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4533 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4535 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 4536 | "$G_SRV -u --mtu 256" \ | 
|  | 4537 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 4538 | 0 \ | 
|  | 4539 | -c "found fragmented DTLS handshake message" \ | 
|  | 4540 | -c "client hello, adding renegotiation extension" \ | 
|  | 4541 | -c "found renegotiation extension" \ | 
|  | 4542 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4543 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4544 | -C "error" \ | 
|  | 4545 | -s "Extra-header:" | 
|  | 4546 |  | 
|  | 4547 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4549 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 4550 | "$G_SRV -u --mtu 256" \ | 
|  | 4551 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 4552 | 0 \ | 
|  | 4553 | -c "found fragmented DTLS handshake message" \ | 
|  | 4554 | -c "client hello, adding renegotiation extension" \ | 
|  | 4555 | -c "found renegotiation extension" \ | 
|  | 4556 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4557 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4558 | -C "error" \ | 
|  | 4559 | -s "Extra-header:" | 
|  | 4560 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4561 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 4562 | "$O_SRV -dtls1 -mtu 2048" \ | 
|  | 4563 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4564 | 0 \ | 
|  | 4565 | -C "found fragmented DTLS handshake message" \ | 
|  | 4566 | -C "error" | 
|  | 4567 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4568 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 4569 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4570 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4571 | 0 \ | 
|  | 4572 | -c "found fragmented DTLS handshake message" \ | 
|  | 4573 | -C "error" | 
|  | 4574 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4575 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4576 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 4577 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4578 | 0 \ | 
|  | 4579 | -c "found fragmented DTLS handshake message" \ | 
|  | 4580 | -C "error" | 
|  | 4581 |  | 
|  | 4582 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 4583 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 4584 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 4585 | 0 \ | 
|  | 4586 | -c "found fragmented DTLS handshake message" \ | 
|  | 4587 | -C "error" | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4588 |  | 
| Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4589 | # Tests for specific things with "unreliable" UDP connection | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4590 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4591 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4592 | run_test    "DTLS proxy: reference" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4593 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4594 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4595 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4596 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4597 | -C "replayed record" \ | 
|  | 4598 | -S "replayed record" \ | 
|  | 4599 | -C "record from another epoch" \ | 
|  | 4600 | -S "record from another epoch" \ | 
|  | 4601 | -C "discarding invalid record" \ | 
|  | 4602 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4603 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4604 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4605 | -c "HTTP/1.0 200 OK" | 
|  | 4606 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4607 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4608 | run_test    "DTLS proxy: duplicate every packet" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4609 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4610 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4611 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4612 | 0 \ | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4613 | -c "replayed record" \ | 
|  | 4614 | -s "replayed record" \ | 
| Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4615 | -c "record from another epoch" \ | 
|  | 4616 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4617 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4618 | -s "Extra-header:" \ | 
|  | 4619 | -c "HTTP/1.0 200 OK" | 
|  | 4620 |  | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4621 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 4622 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4623 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ | 
|  | 4624 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4625 | 0 \ | 
|  | 4626 | -c "replayed record" \ | 
|  | 4627 | -S "replayed record" \ | 
| Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 4628 | -c "record from another epoch" \ | 
|  | 4629 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4630 | -c "resend" \ | 
|  | 4631 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4632 | -s "Extra-header:" \ | 
|  | 4633 | -c "HTTP/1.0 200 OK" | 
|  | 4634 |  | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4635 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4636 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4637 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4638 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4639 | 0 \ | 
|  | 4640 | -c "next record in same datagram" \ | 
|  | 4641 | -s "next record in same datagram" | 
|  | 4642 |  | 
|  | 4643 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4644 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 4645 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4646 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4647 | 0 \ | 
|  | 4648 | -c "next record in same datagram" \ | 
|  | 4649 | -s "next record in same datagram" | 
|  | 4650 |  | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4651 | 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] | 4652 | -p "$P_PXY bad_ad=1" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4653 | "$P_SRV dtls=1 debug_level=1" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4654 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4655 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4656 | -c "discarding invalid record (mac)" \ | 
|  | 4657 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4658 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4659 | -c "HTTP/1.0 200 OK" \ | 
|  | 4660 | -S "too many records with bad MAC" \ | 
|  | 4661 | -S "Verification of the message MAC failed" | 
|  | 4662 |  | 
|  | 4663 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 4664 | -p "$P_PXY bad_ad=1" \ | 
|  | 4665 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ | 
|  | 4666 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
|  | 4667 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4668 | -C "discarding invalid record (mac)" \ | 
|  | 4669 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4670 | -S "Extra-header:" \ | 
|  | 4671 | -C "HTTP/1.0 200 OK" \ | 
|  | 4672 | -s "too many records with bad MAC" \ | 
|  | 4673 | -s "Verification of the message MAC failed" | 
|  | 4674 |  | 
|  | 4675 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 4676 | -p "$P_PXY bad_ad=1" \ | 
|  | 4677 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ | 
|  | 4678 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
|  | 4679 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4680 | -c "discarding invalid record (mac)" \ | 
|  | 4681 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4682 | -s "Extra-header:" \ | 
|  | 4683 | -c "HTTP/1.0 200 OK" \ | 
|  | 4684 | -S "too many records with bad MAC" \ | 
|  | 4685 | -S "Verification of the message MAC failed" | 
|  | 4686 |  | 
|  | 4687 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 4688 | -p "$P_PXY bad_ad=1" \ | 
|  | 4689 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 4690 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ | 
|  | 4691 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4692 | -c "discarding invalid record (mac)" \ | 
|  | 4693 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4694 | -s "Extra-header:" \ | 
|  | 4695 | -c "HTTP/1.0 200 OK" \ | 
|  | 4696 | -s "too many records with bad MAC" \ | 
|  | 4697 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4698 |  | 
|  | 4699 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4700 | -p "$P_PXY delay_ccs=1" \ | 
|  | 4701 | "$P_SRV dtls=1 debug_level=1" \ | 
|  | 4702 | "$P_CLI dtls=1 debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4703 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4704 | -c "record from another epoch" \ | 
|  | 4705 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4706 | -s "Extra-header:" \ | 
|  | 4707 | -c "HTTP/1.0 200 OK" | 
|  | 4708 |  | 
| Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4709 | # 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] | 4710 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4711 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4712 | 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] | 4713 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4714 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 4715 | psk=abc123" \ | 
|  | 4716 | "$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] | 4717 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4718 | 0 \ | 
|  | 4719 | -s "Extra-header:" \ | 
|  | 4720 | -c "HTTP/1.0 200 OK" | 
|  | 4721 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4722 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4723 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 4724 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4725 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 4726 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4727 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4728 | 0 \ | 
|  | 4729 | -s "Extra-header:" \ | 
|  | 4730 | -c "HTTP/1.0 200 OK" | 
|  | 4731 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4732 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4733 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 4734 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4735 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 4736 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4737 | 0 \ | 
|  | 4738 | -s "Extra-header:" \ | 
|  | 4739 | -c "HTTP/1.0 200 OK" | 
|  | 4740 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4741 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4742 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 4743 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4744 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ | 
|  | 4745 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4746 | 0 \ | 
|  | 4747 | -s "Extra-header:" \ | 
|  | 4748 | -c "HTTP/1.0 200 OK" | 
|  | 4749 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4750 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4751 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 4752 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4753 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ | 
|  | 4754 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4755 | 0 \ | 
|  | 4756 | -s "Extra-header:" \ | 
|  | 4757 | -c "HTTP/1.0 200 OK" | 
|  | 4758 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4759 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4760 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 4761 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4762 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ | 
|  | 4763 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4764 | 0 \ | 
|  | 4765 | -s "Extra-header:" \ | 
|  | 4766 | -c "HTTP/1.0 200 OK" | 
|  | 4767 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4768 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4769 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 4770 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4771 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ | 
|  | 4772 | auth_mode=required" \ | 
|  | 4773 | "$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] | 4774 | 0 \ | 
|  | 4775 | -s "Extra-header:" \ | 
|  | 4776 | -c "HTTP/1.0 200 OK" | 
|  | 4777 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4778 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 4779 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 4780 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4781 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 4782 | psk=abc123 debug_level=3" \ | 
|  | 4783 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 4784 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 4785 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4786 | 0 \ | 
|  | 4787 | -s "a session has been resumed" \ | 
|  | 4788 | -c "a session has been resumed" \ | 
|  | 4789 | -s "Extra-header:" \ | 
|  | 4790 | -c "HTTP/1.0 200 OK" | 
|  | 4791 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4792 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 4793 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 4794 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4795 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 4796 | psk=abc123 debug_level=3 nbio=2" \ | 
|  | 4797 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 4798 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 4799 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 4800 | 0 \ | 
|  | 4801 | -s "a session has been resumed" \ | 
|  | 4802 | -c "a session has been resumed" \ | 
|  | 4803 | -s "Extra-header:" \ | 
|  | 4804 | -c "HTTP/1.0 200 OK" | 
|  | 4805 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4806 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4807 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4808 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 4809 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4810 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 4811 | psk=abc123 renegotiation=1 debug_level=2" \ | 
|  | 4812 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 4813 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 4814 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4815 | 0 \ | 
|  | 4816 | -c "=> renegotiate" \ | 
|  | 4817 | -s "=> renegotiate" \ | 
|  | 4818 | -s "Extra-header:" \ | 
|  | 4819 | -c "HTTP/1.0 200 OK" | 
|  | 4820 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4821 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4823 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 4824 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4825 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 4826 | psk=abc123 renegotiation=1 debug_level=2" \ | 
|  | 4827 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 4828 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4829 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4830 | 0 \ | 
|  | 4831 | -c "=> renegotiate" \ | 
|  | 4832 | -s "=> renegotiate" \ | 
|  | 4833 | -s "Extra-header:" \ | 
|  | 4834 | -c "HTTP/1.0 200 OK" | 
|  | 4835 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4836 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4837 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4838 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 4839 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4840 | "$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] | 4841 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4842 | debug_level=2" \ | 
|  | 4843 | "$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] | 4844 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4845 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4846 | 0 \ | 
|  | 4847 | -c "=> renegotiate" \ | 
|  | 4848 | -s "=> renegotiate" \ | 
|  | 4849 | -s "Extra-header:" \ | 
|  | 4850 | -c "HTTP/1.0 200 OK" | 
|  | 4851 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4852 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4854 | 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] | 4855 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4856 | "$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] | 4857 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4858 | debug_level=2 nbio=2" \ | 
|  | 4859 | "$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] | 4860 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4861 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 4862 | 0 \ | 
|  | 4863 | -c "=> renegotiate" \ | 
|  | 4864 | -s "=> renegotiate" \ | 
|  | 4865 | -s "Extra-header:" \ | 
|  | 4866 | -c "HTTP/1.0 200 OK" | 
|  | 4867 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4868 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4869 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4870 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4871 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4872 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4873 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4874 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4875 | -c "HTTP/1.0 200 OK" | 
|  | 4876 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4877 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4878 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4879 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 4880 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4881 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4882 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4883 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4884 | -c "HTTP/1.0 200 OK" | 
|  | 4885 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4886 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4887 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4888 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 4889 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4890 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4891 | "$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] | 4892 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4893 | -c "HTTP/1.0 200 OK" | 
|  | 4894 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4895 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4896 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4897 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4898 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 4899 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4900 | "$G_SRV -u --mtu 2048 -a" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4901 | "$P_CLI dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4902 | 0 \ | 
|  | 4903 | -s "Extra-header:" \ | 
|  | 4904 | -c "Extra-header:" | 
|  | 4905 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4906 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4907 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4908 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4909 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 4910 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4911 | "$G_SRV -u --mtu 512" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4912 | "$P_CLI dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4913 | 0 \ | 
|  | 4914 | -s "Extra-header:" \ | 
|  | 4915 | -c "Extra-header:" | 
|  | 4916 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4917 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4918 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4919 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4920 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 4921 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4922 | "$G_SRV -u --mtu 512" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4923 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4924 | 0 \ | 
|  | 4925 | -s "Extra-header:" \ | 
|  | 4926 | -c "Extra-header:" | 
|  | 4927 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4928 | # Final report | 
|  | 4929 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4930 | echo "------------------------------------------------------------------------" | 
|  | 4931 |  | 
|  | 4932 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 4933 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4934 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 4935 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4936 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 4937 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 4938 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4939 |  | 
|  | 4940 | exit $FAILS |