| 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 |  | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 234 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot ]; then | 
|  | 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 |  | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 289 | # wait for server to start: two versions depending on lsof availability | 
|  | 290 | wait_server_start() { | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 291 | if which lsof >/dev/null 2>&1; then | 
| Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 292 | START_TIME=$( date +%s ) | 
|  | 293 | DONE=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 294 |  | 
|  | 295 | # make a tight loop, server usually takes less than 1 sec to start | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 296 | if [ "$DTLS" -eq 1 ]; then | 
| Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 297 | while [ $DONE -eq 0 ]; do | 
|  | 298 | if lsof -nbi UDP:"$SRV_PORT" 2>/dev/null | grep UDP >/dev/null | 
|  | 299 | then | 
|  | 300 | DONE=1 | 
|  | 301 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then | 
|  | 302 | echo "SERVERSTART TIMEOUT" | 
|  | 303 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT | 
|  | 304 | DONE=1 | 
|  | 305 | fi | 
|  | 306 | done | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 307 | else | 
| Manuel Pégourié-Gonnard | 74681fa | 2015-08-04 20:34:39 +0200 | [diff] [blame] | 308 | while [ $DONE -eq 0 ]; do | 
|  | 309 | if lsof -nbi TCP:"$SRV_PORT" 2>/dev/null | grep LISTEN >/dev/null | 
|  | 310 | then | 
|  | 311 | DONE=1 | 
|  | 312 | elif [ $(( $( date +%s ) - $START_TIME )) -gt $DOG_DELAY ]; then | 
|  | 313 | echo "SERVERSTART TIMEOUT" | 
|  | 314 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT | 
|  | 315 | DONE=1 | 
|  | 316 | fi | 
|  | 317 | done | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 318 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 319 | else | 
|  | 320 | sleep "$START_DELAY" | 
|  | 321 | fi | 
|  | 322 | } | 
|  | 323 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 324 | # wait for client to terminate and set CLI_EXIT | 
|  | 325 | # must be called right after starting the client | 
|  | 326 | wait_client_done() { | 
|  | 327 | CLI_PID=$! | 
|  | 328 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 329 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 330 | CLI_DELAY_FACTOR=1 | 
|  | 331 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 332 | ( 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] | 333 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 334 |  | 
|  | 335 | wait $CLI_PID | 
|  | 336 | CLI_EXIT=$? | 
|  | 337 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 338 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 339 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 340 |  | 
|  | 341 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 342 |  | 
|  | 343 | sleep $SRV_DELAY_SECONDS | 
|  | 344 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 345 | } | 
|  | 346 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 347 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 348 | detect_dtls() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 349 | 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] | 350 | DTLS=1 | 
|  | 351 | else | 
|  | 352 | DTLS=0 | 
|  | 353 | fi | 
|  | 354 | } | 
|  | 355 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 356 | # 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] | 357 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 358 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 359 | #           -u pattern  lines after pattern must be unique in client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 360 | #           -S pattern  pattern that must be absent in server output | 
|  | 361 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 362 | #           -U pattern  lines after pattern must be unique in server output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 363 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 364 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 365 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 366 |  | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 367 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : | 
|  | 368 | else | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 369 | SKIP_NEXT="NO" | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 370 | return | 
|  | 371 | fi | 
|  | 372 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 373 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 374 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 375 | # Do we only run numbered tests? | 
|  | 376 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : | 
|  | 377 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : | 
|  | 378 | else | 
|  | 379 | SKIP_NEXT="YES" | 
|  | 380 | fi | 
|  | 381 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 382 | # should we skip? | 
|  | 383 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 384 | SKIP_NEXT="NO" | 
|  | 385 | echo "SKIP" | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 386 | SKIPS=$(( $SKIPS + 1 )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 387 | return | 
|  | 388 | fi | 
|  | 389 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 390 | # does this test use a proxy? | 
|  | 391 | if [ "X$1" = "X-p" ]; then | 
|  | 392 | PXY_CMD="$2" | 
|  | 393 | shift 2 | 
|  | 394 | else | 
|  | 395 | PXY_CMD="" | 
|  | 396 | fi | 
|  | 397 |  | 
|  | 398 | # get commands and client output | 
|  | 399 | SRV_CMD="$1" | 
|  | 400 | CLI_CMD="$2" | 
|  | 401 | CLI_EXPECT="$3" | 
|  | 402 | shift 3 | 
|  | 403 |  | 
|  | 404 | # fix client port | 
|  | 405 | if [ -n "$PXY_CMD" ]; then | 
|  | 406 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 407 | else | 
|  | 408 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 409 | fi | 
|  | 410 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 411 | # update DTLS variable | 
|  | 412 | detect_dtls "$SRV_CMD" | 
|  | 413 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 414 | # prepend valgrind to our commands if active | 
|  | 415 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 416 | if is_polar "$SRV_CMD"; then | 
|  | 417 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 418 | fi | 
|  | 419 | if is_polar "$CLI_CMD"; then | 
|  | 420 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 421 | fi | 
|  | 422 | fi | 
|  | 423 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 424 | TIMES_LEFT=2 | 
|  | 425 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 426 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 427 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 428 | # run the commands | 
|  | 429 | if [ -n "$PXY_CMD" ]; then | 
|  | 430 | echo "$PXY_CMD" > $PXY_OUT | 
|  | 431 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 432 | PXY_PID=$! | 
|  | 433 | # assume proxy starts faster than server | 
|  | 434 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 435 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 436 | check_osrv_dtls | 
|  | 437 | echo "$SRV_CMD" > $SRV_OUT | 
|  | 438 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 439 | SRV_PID=$! | 
|  | 440 | wait_server_start | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 441 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 442 | echo "$CLI_CMD" > $CLI_OUT | 
|  | 443 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 444 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 445 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 446 | # terminate the server (and the proxy) | 
|  | 447 | kill $SRV_PID | 
|  | 448 | wait $SRV_PID | 
|  | 449 | if [ -n "$PXY_CMD" ]; then | 
|  | 450 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 451 | wait $PXY_PID | 
|  | 452 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 453 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 454 | # retry only on timeouts | 
|  | 455 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 456 | printf "RETRY " | 
|  | 457 | else | 
|  | 458 | TIMES_LEFT=0 | 
|  | 459 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 460 | done | 
|  | 461 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 462 | # 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] | 463 | # (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] | 464 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 465 | # failure) | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 466 | if is_polar "$SRV_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 467 | 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] | 468 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 469 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 470 | return | 
|  | 471 | fi | 
|  | 472 | fi | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 473 | if is_polar "$CLI_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 474 | 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] | 475 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 476 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 477 | return | 
|  | 478 | fi | 
|  | 479 | fi | 
|  | 480 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 481 | # check server exit code | 
|  | 482 | if [ $? != 0 ]; then | 
|  | 483 | fail "server fail" | 
|  | 484 | return | 
|  | 485 | fi | 
|  | 486 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 487 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 488 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 489 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 490 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 491 | 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] | 492 | return | 
|  | 493 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 494 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 495 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 496 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 497 | # 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] | 498 | while [ $# -gt 0 ] | 
|  | 499 | do | 
|  | 500 | case $1 in | 
|  | 501 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 502 | 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] | 503 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 504 | return | 
|  | 505 | fi | 
|  | 506 | ;; | 
|  | 507 |  | 
|  | 508 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 509 | 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] | 510 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 511 | return | 
|  | 512 | fi | 
|  | 513 | ;; | 
|  | 514 |  | 
|  | 515 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 516 | 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] | 517 | 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] | 518 | return | 
|  | 519 | fi | 
|  | 520 | ;; | 
|  | 521 |  | 
|  | 522 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 523 | 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] | 524 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 525 | return | 
|  | 526 | fi | 
|  | 527 | ;; | 
|  | 528 |  | 
|  | 529 | # The filtering in the following two options (-u and -U) do the following | 
|  | 530 | #   - ignore valgrind output | 
|  | 531 | #   - filter out everything but lines right after the pattern occurances | 
|  | 532 | #   - keep one of each non-unique line | 
|  | 533 | #   - count how many lines remain | 
|  | 534 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 535 | # if there were no duplicates. | 
|  | 536 | "-U") | 
|  | 537 | 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 | 
|  | 538 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 539 | return | 
|  | 540 | fi | 
|  | 541 | ;; | 
|  | 542 |  | 
|  | 543 | "-u") | 
|  | 544 | 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 | 
|  | 545 | 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] | 546 | return | 
|  | 547 | fi | 
|  | 548 | ;; | 
|  | 549 |  | 
|  | 550 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 551 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 552 | exit 1 | 
|  | 553 | esac | 
|  | 554 | shift 2 | 
|  | 555 | done | 
|  | 556 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 557 | # check valgrind's results | 
|  | 558 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 559 | 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] | 560 | fail "Server has memory errors" | 
|  | 561 | return | 
|  | 562 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 563 | 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] | 564 | fail "Client has memory errors" | 
|  | 565 | return | 
|  | 566 | fi | 
|  | 567 | fi | 
|  | 568 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 569 | # if we're here, everything is ok | 
|  | 570 | echo "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 571 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 572 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 573 | mv $CLI_OUT o-cli-${TESTS}.log | 
|  | 574 | fi | 
|  | 575 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 576 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 577 | } | 
|  | 578 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 579 | cleanup() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 580 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 581 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 582 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 583 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 584 | 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] | 585 | exit 1 | 
|  | 586 | } | 
|  | 587 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 588 | # | 
|  | 589 | # MAIN | 
|  | 590 | # | 
|  | 591 |  | 
| Manuel Pégourié-Gonnard | 19db8ea | 2015-03-10 13:41:04 +0000 | [diff] [blame] | 592 | if cd $( dirname $0 ); then :; else | 
|  | 593 | echo "cd $( dirname $0 ) failed" >&2 | 
|  | 594 | exit 1 | 
|  | 595 | fi | 
|  | 596 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 597 | get_options "$@" | 
|  | 598 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 599 | # sanity checks, avoid an avalanche of errors | 
|  | 600 | if [ ! -x "$P_SRV" ]; then | 
|  | 601 | echo "Command '$P_SRV' is not an executable file" | 
|  | 602 | exit 1 | 
|  | 603 | fi | 
|  | 604 | if [ ! -x "$P_CLI" ]; then | 
|  | 605 | echo "Command '$P_CLI' is not an executable file" | 
|  | 606 | exit 1 | 
|  | 607 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 608 | if [ ! -x "$P_PXY" ]; then | 
|  | 609 | echo "Command '$P_PXY' is not an executable file" | 
|  | 610 | exit 1 | 
|  | 611 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 612 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 613 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 614 | echo "Memcheck not possible. Valgrind not found" | 
|  | 615 | exit 1 | 
|  | 616 | fi | 
|  | 617 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 618 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 619 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 620 | exit 1 | 
|  | 621 | fi | 
|  | 622 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 623 | # used by watchdog | 
|  | 624 | MAIN_PID="$$" | 
|  | 625 |  | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 626 | # be more patient with valgrind | 
|  | 627 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 628 | START_DELAY=3 | 
|  | 629 | DOG_DELAY=30 | 
|  | 630 | else | 
|  | 631 | START_DELAY=1 | 
|  | 632 | DOG_DELAY=10 | 
|  | 633 | fi | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 634 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 635 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 636 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 637 | # 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] | 638 | # +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] | 639 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 640 | 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] | 641 | 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] | 642 | 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] | 643 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" | 
|  | 644 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 645 | G_CLI="$G_CLI -p +SRV_PORT localhost" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 646 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 647 | # Allow SHA-1, because many of our test certificates use it | 
|  | 648 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 649 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 650 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 651 | # Also pick a unique name for intermediate files | 
|  | 652 | SRV_OUT="srv_out.$$" | 
|  | 653 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 654 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 655 | SESSION="session.$$" | 
|  | 656 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 657 | SKIP_NEXT="NO" | 
|  | 658 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 659 | trap cleanup INT TERM HUP | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 661 | # Basic test | 
|  | 662 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 663 | # Checks that: | 
|  | 664 | # - things work with all ciphersuites active (used with config-full in all.sh) | 
|  | 665 | # - the expected (highest security) parameters are selected | 
|  | 666 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 667 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 668 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 669 | "$P_CLI" \ | 
|  | 670 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 671 | -s "Protocol is TLSv1.2" \ | 
|  | 672 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 673 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 674 | -s "ECDHE curve: secp521r1" \ | 
|  | 675 | -S "error" \ | 
|  | 676 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 677 |  | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 678 | run_test    "Default, DTLS" \ | 
|  | 679 | "$P_SRV dtls=1" \ | 
|  | 680 | "$P_CLI dtls=1" \ | 
|  | 681 | 0 \ | 
|  | 682 | -s "Protocol is DTLSv1.2" \ | 
|  | 683 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" | 
|  | 684 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 685 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 686 | run_test    "Unique IV in GCM" \ | 
|  | 687 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 688 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 689 | 0 \ | 
|  | 690 | -u "IV used" \ | 
|  | 691 | -U "IV used" | 
|  | 692 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 693 | # Tests for rc4 option | 
|  | 694 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 695 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 696 | run_test    "RC4: server disabled, client enabled" \ | 
|  | 697 | "$P_SRV" \ | 
|  | 698 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 699 | 1 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 700 | -s "SSL - The server has no ciphersuites in common" | 
|  | 701 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 702 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 703 | run_test    "RC4: server half, client enabled" \ | 
|  | 704 | "$P_SRV arc4=1" \ | 
|  | 705 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 706 | 1 \ | 
|  | 707 | -s "SSL - The server has no ciphersuites in common" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 708 |  | 
|  | 709 | run_test    "RC4: server enabled, client disabled" \ | 
|  | 710 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 711 | "$P_CLI" \ | 
|  | 712 | 1 \ | 
|  | 713 | -s "SSL - The server has no ciphersuites in common" | 
|  | 714 |  | 
|  | 715 | run_test    "RC4: both enabled" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 716 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 717 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 718 | 0 \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 719 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 720 | -S "SSL - The server has no ciphersuites in common" | 
|  | 721 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 722 | # Tests for SHA-1 support | 
|  | 723 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 724 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 725 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 726 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 727 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 728 | 1 \ | 
|  | 729 | -c "The certificate is signed with an unacceptable hash" | 
|  | 730 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 731 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 732 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 733 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 734 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 735 | 0 | 
|  | 736 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 737 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 738 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 739 | "$P_CLI allow_sha1=1" \ | 
|  | 740 | 0 | 
|  | 741 |  | 
|  | 742 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 743 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 744 | "$P_CLI allow_sha1=0" \ | 
|  | 745 | 0 | 
|  | 746 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 747 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 748 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 749 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 750 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 751 | 1 \ | 
|  | 752 | -s "The certificate is signed with an unacceptable hash" | 
|  | 753 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 754 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 755 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 756 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 757 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 758 | 0 | 
|  | 759 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 760 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 761 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 762 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 763 | 0 | 
|  | 764 |  | 
|  | 765 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 766 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 767 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 768 | 0 | 
|  | 769 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 770 | # Tests for Truncated HMAC extension | 
|  | 771 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 772 | run_test    "Truncated HMAC: client default, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 773 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 774 | "$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] | 775 | 0 \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 776 | -s "dumping 'computed mac' (20 bytes)" \ | 
|  | 777 | -S "dumping 'computed mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 778 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 779 | run_test    "Truncated HMAC: client disabled, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 780 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 781 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 782 | trunc_hmac=0" \ | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 783 | 0 \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 784 | -s "dumping 'computed mac' (20 bytes)" \ | 
|  | 785 | -S "dumping 'computed mac' (10 bytes)" | 
|  | 786 |  | 
|  | 787 | run_test    "Truncated HMAC: client enabled, server default" \ | 
|  | 788 | "$P_SRV debug_level=4" \ | 
|  | 789 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 790 | trunc_hmac=1" \ | 
|  | 791 | 0 \ | 
| Manuel Pégourié-Gonnard | 662c6e8 | 2015-05-06 17:39:23 +0100 | [diff] [blame] | 792 | -s "dumping 'computed mac' (20 bytes)" \ | 
|  | 793 | -S "dumping 'computed mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 794 |  | 
|  | 795 | run_test    "Truncated HMAC: client enabled, server disabled" \ | 
|  | 796 | "$P_SRV debug_level=4 trunc_hmac=0" \ | 
|  | 797 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 798 | trunc_hmac=1" \ | 
|  | 799 | 0 \ | 
|  | 800 | -s "dumping 'computed mac' (20 bytes)" \ | 
|  | 801 | -S "dumping 'computed mac' (10 bytes)" | 
|  | 802 |  | 
|  | 803 | run_test    "Truncated HMAC: client enabled, server enabled" \ | 
|  | 804 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
|  | 805 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 806 | trunc_hmac=1" \ | 
|  | 807 | 0 \ | 
|  | 808 | -S "dumping 'computed mac' (20 bytes)" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 809 | -s "dumping 'computed mac' (10 bytes)" | 
|  | 810 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 811 | # Tests for Encrypt-then-MAC extension | 
|  | 812 |  | 
|  | 813 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 814 | "$P_SRV debug_level=3 \ | 
|  | 815 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 816 | "$P_CLI debug_level=3" \ | 
|  | 817 | 0 \ | 
|  | 818 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 819 | -s "found encrypt then mac extension" \ | 
|  | 820 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 821 | -c "found encrypt_then_mac extension" \ | 
|  | 822 | -c "using encrypt then mac" \ | 
|  | 823 | -s "using encrypt then mac" | 
|  | 824 |  | 
|  | 825 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 826 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 827 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 828 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 829 | 0 \ | 
|  | 830 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 831 | -s "found encrypt then mac extension" \ | 
|  | 832 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 833 | -C "found encrypt_then_mac extension" \ | 
|  | 834 | -C "using encrypt then mac" \ | 
|  | 835 | -S "using encrypt then mac" | 
|  | 836 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 837 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 838 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 839 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 840 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 841 | 0 \ | 
|  | 842 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 843 | -s "found encrypt then mac extension" \ | 
|  | 844 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 845 | -C "found encrypt_then_mac extension" \ | 
|  | 846 | -C "using encrypt then mac" \ | 
|  | 847 | -S "using encrypt then mac" | 
|  | 848 |  | 
|  | 849 | run_test    "Encrypt then MAC: client enabled, stream cipher" \ | 
|  | 850 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 851 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 852 | "$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] | 853 | 0 \ | 
|  | 854 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 855 | -s "found encrypt then mac extension" \ | 
|  | 856 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 857 | -C "found encrypt_then_mac extension" \ | 
|  | 858 | -C "using encrypt then mac" \ | 
|  | 859 | -S "using encrypt then mac" | 
|  | 860 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 861 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 862 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 863 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 864 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 865 | 0 \ | 
|  | 866 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 867 | -S "found encrypt then mac extension" \ | 
|  | 868 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 869 | -C "found encrypt_then_mac extension" \ | 
|  | 870 | -C "using encrypt then mac" \ | 
|  | 871 | -S "using encrypt then mac" | 
|  | 872 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 873 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 874 | run_test    "Encrypt then MAC: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 875 | "$P_SRV debug_level=3 min_version=ssl3 \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 876 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 877 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 878 | 0 \ | 
|  | 879 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 880 | -S "found encrypt then mac extension" \ | 
|  | 881 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 882 | -C "found encrypt_then_mac extension" \ | 
|  | 883 | -C "using encrypt then mac" \ | 
|  | 884 | -S "using encrypt then mac" | 
|  | 885 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 886 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 887 | run_test    "Encrypt then MAC: client enabled, server SSLv3" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 888 | "$P_SRV debug_level=3 force_version=ssl3 \ | 
|  | 889 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 890 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 891 | 0 \ | 
|  | 892 | -c "client hello, adding encrypt_then_mac extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 893 | -S "found encrypt then mac extension" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 894 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 895 | -C "found encrypt_then_mac extension" \ | 
|  | 896 | -C "using encrypt then mac" \ | 
|  | 897 | -S "using encrypt then mac" | 
|  | 898 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 899 | # Tests for Extended Master Secret extension | 
|  | 900 |  | 
|  | 901 | run_test    "Extended Master Secret: default" \ | 
|  | 902 | "$P_SRV debug_level=3" \ | 
|  | 903 | "$P_CLI debug_level=3" \ | 
|  | 904 | 0 \ | 
|  | 905 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 906 | -s "found extended master secret extension" \ | 
|  | 907 | -s "server hello, adding extended master secret extension" \ | 
|  | 908 | -c "found extended_master_secret extension" \ | 
|  | 909 | -c "using extended master secret" \ | 
|  | 910 | -s "using extended master secret" | 
|  | 911 |  | 
|  | 912 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 913 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 914 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 915 | 0 \ | 
|  | 916 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 917 | -s "found extended master secret extension" \ | 
|  | 918 | -S "server hello, adding extended master secret extension" \ | 
|  | 919 | -C "found extended_master_secret extension" \ | 
|  | 920 | -C "using extended master secret" \ | 
|  | 921 | -S "using extended master secret" | 
|  | 922 |  | 
|  | 923 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 924 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 925 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 926 | 0 \ | 
|  | 927 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 928 | -S "found extended master secret extension" \ | 
|  | 929 | -S "server hello, adding extended master secret extension" \ | 
|  | 930 | -C "found extended_master_secret extension" \ | 
|  | 931 | -C "using extended master secret" \ | 
|  | 932 | -S "using extended master secret" | 
|  | 933 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 934 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 935 | run_test    "Extended Master Secret: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 936 | "$P_SRV debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 937 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 938 | 0 \ | 
|  | 939 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 940 | -S "found extended master secret extension" \ | 
|  | 941 | -S "server hello, adding extended master secret extension" \ | 
|  | 942 | -C "found extended_master_secret extension" \ | 
|  | 943 | -C "using extended master secret" \ | 
|  | 944 | -S "using extended master secret" | 
|  | 945 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 946 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 947 | run_test    "Extended Master Secret: client enabled, server SSLv3" \ | 
|  | 948 | "$P_SRV debug_level=3 force_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 949 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 950 | 0 \ | 
|  | 951 | -c "client hello, adding extended_master_secret extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 952 | -S "found extended master secret extension" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 953 | -S "server hello, adding extended master secret extension" \ | 
|  | 954 | -C "found extended_master_secret extension" \ | 
|  | 955 | -C "using extended master secret" \ | 
|  | 956 | -S "using extended master secret" | 
|  | 957 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 958 | # Tests for FALLBACK_SCSV | 
|  | 959 |  | 
|  | 960 | run_test    "Fallback SCSV: default" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 961 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 962 | "$P_CLI debug_level=3 force_version=tls1_1" \ | 
|  | 963 | 0 \ | 
|  | 964 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 965 | -S "received FALLBACK_SCSV" \ | 
|  | 966 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 967 | -C "is a fatal alert message (msg 86)" | 
|  | 968 |  | 
|  | 969 | run_test    "Fallback SCSV: explicitly disabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 970 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 971 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 972 | 0 \ | 
|  | 973 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 974 | -S "received FALLBACK_SCSV" \ | 
|  | 975 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 976 | -C "is a fatal alert message (msg 86)" | 
|  | 977 |  | 
|  | 978 | run_test    "Fallback SCSV: enabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 979 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 980 | "$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] | 981 | 1 \ | 
|  | 982 | -c "adding FALLBACK_SCSV" \ | 
|  | 983 | -s "received FALLBACK_SCSV" \ | 
|  | 984 | -s "inapropriate fallback" \ | 
|  | 985 | -c "is a fatal alert message (msg 86)" | 
|  | 986 |  | 
|  | 987 | run_test    "Fallback SCSV: enabled, max version" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 988 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 989 | "$P_CLI debug_level=3 fallback=1" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 990 | 0 \ | 
|  | 991 | -c "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 992 | -s "received FALLBACK_SCSV" \ | 
|  | 993 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 994 | -C "is a fatal alert message (msg 86)" | 
|  | 995 |  | 
|  | 996 | requires_openssl_with_fallback_scsv | 
|  | 997 | run_test    "Fallback SCSV: default, openssl server" \ | 
|  | 998 | "$O_SRV" \ | 
|  | 999 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 1000 | 0 \ | 
|  | 1001 | -C "adding FALLBACK_SCSV" \ | 
|  | 1002 | -C "is a fatal alert message (msg 86)" | 
|  | 1003 |  | 
|  | 1004 | requires_openssl_with_fallback_scsv | 
|  | 1005 | run_test    "Fallback SCSV: enabled, openssl server" \ | 
|  | 1006 | "$O_SRV" \ | 
|  | 1007 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ | 
|  | 1008 | 1 \ | 
|  | 1009 | -c "adding FALLBACK_SCSV" \ | 
|  | 1010 | -c "is a fatal alert message (msg 86)" | 
|  | 1011 |  | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1012 | requires_openssl_with_fallback_scsv | 
|  | 1013 | run_test    "Fallback SCSV: disabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1014 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1015 | "$O_CLI -tls1_1" \ | 
|  | 1016 | 0 \ | 
|  | 1017 | -S "received FALLBACK_SCSV" \ | 
|  | 1018 | -S "inapropriate fallback" | 
|  | 1019 |  | 
|  | 1020 | requires_openssl_with_fallback_scsv | 
|  | 1021 | run_test    "Fallback SCSV: enabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1022 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1023 | "$O_CLI -tls1_1 -fallback_scsv" \ | 
|  | 1024 | 1 \ | 
|  | 1025 | -s "received FALLBACK_SCSV" \ | 
|  | 1026 | -s "inapropriate fallback" | 
|  | 1027 |  | 
|  | 1028 | requires_openssl_with_fallback_scsv | 
|  | 1029 | run_test    "Fallback SCSV: enabled, max version, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1030 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1031 | "$O_CLI -fallback_scsv" \ | 
|  | 1032 | 0 \ | 
|  | 1033 | -s "received FALLBACK_SCSV" \ | 
|  | 1034 | -S "inapropriate fallback" | 
|  | 1035 |  | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1036 | ## ClientHello generated with | 
|  | 1037 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." | 
|  | 1038 | ## then manually twiddling the ciphersuite list. | 
|  | 1039 | ## The ClientHello content is spelled out below as a hex string as | 
|  | 1040 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". | 
|  | 1041 | ## The expected response is an inappropriate_fallback alert. | 
|  | 1042 | requires_openssl_with_fallback_scsv | 
|  | 1043 | run_test    "Fallback SCSV: beginning of list" \ | 
|  | 1044 | "$P_SRV debug_level=2" \ | 
|  | 1045 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1046 | 0 \ | 
|  | 1047 | -s "received FALLBACK_SCSV" \ | 
|  | 1048 | -s "inapropriate fallback" | 
|  | 1049 |  | 
|  | 1050 | requires_openssl_with_fallback_scsv | 
|  | 1051 | run_test    "Fallback SCSV: end of list" \ | 
|  | 1052 | "$P_SRV debug_level=2" \ | 
|  | 1053 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1054 | 0 \ | 
|  | 1055 | -s "received FALLBACK_SCSV" \ | 
|  | 1056 | -s "inapropriate fallback" | 
|  | 1057 |  | 
|  | 1058 | ## Here the expected response is a valid ServerHello prefix, up to the random. | 
|  | 1059 | requires_openssl_with_fallback_scsv | 
|  | 1060 | run_test    "Fallback SCSV: not in list" \ | 
|  | 1061 | "$P_SRV debug_level=2" \ | 
|  | 1062 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ | 
|  | 1063 | 0 \ | 
|  | 1064 | -S "received FALLBACK_SCSV" \ | 
|  | 1065 | -S "inapropriate fallback" | 
|  | 1066 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1067 | # Tests for CBC 1/n-1 record splitting | 
|  | 1068 |  | 
|  | 1069 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 1070 | "$P_SRV" \ | 
|  | 1071 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1072 | request_size=123 force_version=tls1_2" \ | 
|  | 1073 | 0 \ | 
|  | 1074 | -s "Read from client: 123 bytes read" \ | 
|  | 1075 | -S "Read from client: 1 bytes read" \ | 
|  | 1076 | -S "122 bytes read" | 
|  | 1077 |  | 
|  | 1078 | run_test    "CBC Record splitting: TLS 1.1, no splitting" \ | 
|  | 1079 | "$P_SRV" \ | 
|  | 1080 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1081 | request_size=123 force_version=tls1_1" \ | 
|  | 1082 | 0 \ | 
|  | 1083 | -s "Read from client: 123 bytes read" \ | 
|  | 1084 | -S "Read from client: 1 bytes read" \ | 
|  | 1085 | -S "122 bytes read" | 
|  | 1086 |  | 
|  | 1087 | run_test    "CBC Record splitting: TLS 1.0, splitting" \ | 
|  | 1088 | "$P_SRV" \ | 
|  | 1089 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1090 | request_size=123 force_version=tls1" \ | 
|  | 1091 | 0 \ | 
|  | 1092 | -S "Read from client: 123 bytes read" \ | 
|  | 1093 | -s "Read from client: 1 bytes read" \ | 
|  | 1094 | -s "122 bytes read" | 
|  | 1095 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1096 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1097 | run_test    "CBC Record splitting: SSLv3, splitting" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1098 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1099 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1100 | request_size=123 force_version=ssl3" \ | 
|  | 1101 | 0 \ | 
|  | 1102 | -S "Read from client: 123 bytes read" \ | 
|  | 1103 | -s "Read from client: 1 bytes read" \ | 
|  | 1104 | -s "122 bytes read" | 
|  | 1105 |  | 
|  | 1106 | 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] | 1107 | "$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] | 1108 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 1109 | request_size=123 force_version=tls1" \ | 
|  | 1110 | 0 \ | 
|  | 1111 | -s "Read from client: 123 bytes read" \ | 
|  | 1112 | -S "Read from client: 1 bytes read" \ | 
|  | 1113 | -S "122 bytes read" | 
|  | 1114 |  | 
|  | 1115 | run_test    "CBC Record splitting: TLS 1.0, splitting disabled" \ | 
|  | 1116 | "$P_SRV" \ | 
|  | 1117 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1118 | request_size=123 force_version=tls1 recsplit=0" \ | 
|  | 1119 | 0 \ | 
|  | 1120 | -s "Read from client: 123 bytes read" \ | 
|  | 1121 | -S "Read from client: 1 bytes read" \ | 
|  | 1122 | -S "122 bytes read" | 
|  | 1123 |  | 
| Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1124 | run_test    "CBC Record splitting: TLS 1.0, splitting, nbio" \ | 
|  | 1125 | "$P_SRV nbio=2" \ | 
|  | 1126 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1127 | request_size=123 force_version=tls1" \ | 
|  | 1128 | 0 \ | 
|  | 1129 | -S "Read from client: 123 bytes read" \ | 
|  | 1130 | -s "Read from client: 1 bytes read" \ | 
|  | 1131 | -s "122 bytes read" | 
|  | 1132 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1133 | # Tests for Session Tickets | 
|  | 1134 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1135 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1136 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1137 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1138 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1139 | -c "client hello, adding session ticket extension" \ | 
|  | 1140 | -s "found session ticket extension" \ | 
|  | 1141 | -s "server hello, adding session ticket extension" \ | 
|  | 1142 | -c "found session_ticket extension" \ | 
|  | 1143 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1144 | -S "session successfully restored from cache" \ | 
|  | 1145 | -s "session successfully restored from ticket" \ | 
|  | 1146 | -s "a session has been resumed" \ | 
|  | 1147 | -c "a session has been resumed" | 
|  | 1148 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1149 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1150 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 1151 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1152 | 0 \ | 
|  | 1153 | -c "client hello, adding session ticket extension" \ | 
|  | 1154 | -s "found session ticket extension" \ | 
|  | 1155 | -s "server hello, adding session ticket extension" \ | 
|  | 1156 | -c "found session_ticket extension" \ | 
|  | 1157 | -c "parse new session ticket" \ | 
|  | 1158 | -S "session successfully restored from cache" \ | 
|  | 1159 | -s "session successfully restored from ticket" \ | 
|  | 1160 | -s "a session has been resumed" \ | 
|  | 1161 | -c "a session has been resumed" | 
|  | 1162 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1163 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1164 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 1165 | "$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] | 1166 | 0 \ | 
|  | 1167 | -c "client hello, adding session ticket extension" \ | 
|  | 1168 | -s "found session ticket extension" \ | 
|  | 1169 | -s "server hello, adding session ticket extension" \ | 
|  | 1170 | -c "found session_ticket extension" \ | 
|  | 1171 | -c "parse new session ticket" \ | 
|  | 1172 | -S "session successfully restored from cache" \ | 
|  | 1173 | -S "session successfully restored from ticket" \ | 
|  | 1174 | -S "a session has been resumed" \ | 
|  | 1175 | -C "a session has been resumed" | 
|  | 1176 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1177 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1178 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1179 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1180 | 0 \ | 
|  | 1181 | -c "client hello, adding session ticket extension" \ | 
|  | 1182 | -c "found session_ticket extension" \ | 
|  | 1183 | -c "parse new session ticket" \ | 
|  | 1184 | -c "a session has been resumed" | 
|  | 1185 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1186 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1187 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1188 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1189 | $O_CLI -sess_in $SESSION; \ | 
|  | 1190 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1191 | 0 \ | 
|  | 1192 | -s "found session ticket extension" \ | 
|  | 1193 | -s "server hello, adding session ticket extension" \ | 
|  | 1194 | -S "session successfully restored from cache" \ | 
|  | 1195 | -s "session successfully restored from ticket" \ | 
|  | 1196 | -s "a session has been resumed" | 
|  | 1197 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1198 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1199 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1200 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1201 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1202 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1203 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1204 | -c "client hello, adding session ticket extension" \ | 
|  | 1205 | -s "found session ticket extension" \ | 
|  | 1206 | -S "server hello, adding session ticket extension" \ | 
|  | 1207 | -C "found session_ticket extension" \ | 
|  | 1208 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1209 | -s "session successfully restored from cache" \ | 
|  | 1210 | -S "session successfully restored from ticket" \ | 
|  | 1211 | -s "a session has been resumed" \ | 
|  | 1212 | -c "a session has been resumed" | 
|  | 1213 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1214 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1215 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1216 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1217 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1218 | -C "client hello, adding session ticket extension" \ | 
|  | 1219 | -S "found session ticket extension" \ | 
|  | 1220 | -S "server hello, adding session ticket extension" \ | 
|  | 1221 | -C "found session_ticket extension" \ | 
|  | 1222 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1223 | -s "session successfully restored from cache" \ | 
|  | 1224 | -S "session successfully restored from ticket" \ | 
|  | 1225 | -s "a session has been resumed" \ | 
|  | 1226 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1227 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1228 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1229 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 1230 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1231 | 0 \ | 
|  | 1232 | -S "session successfully restored from cache" \ | 
|  | 1233 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1234 | -S "a session has been resumed" \ | 
|  | 1235 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1236 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1237 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1238 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 1239 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1240 | 0 \ | 
|  | 1241 | -s "session successfully restored from cache" \ | 
|  | 1242 | -S "session successfully restored from ticket" \ | 
|  | 1243 | -s "a session has been resumed" \ | 
|  | 1244 | -c "a session has been resumed" | 
|  | 1245 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1246 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1247 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1248 | "$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] | 1249 | 0 \ | 
|  | 1250 | -s "session successfully restored from cache" \ | 
|  | 1251 | -S "session successfully restored from ticket" \ | 
|  | 1252 | -s "a session has been resumed" \ | 
|  | 1253 | -c "a session has been resumed" | 
|  | 1254 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1255 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1256 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 1257 | "$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] | 1258 | 0 \ | 
|  | 1259 | -S "session successfully restored from cache" \ | 
|  | 1260 | -S "session successfully restored from ticket" \ | 
|  | 1261 | -S "a session has been resumed" \ | 
|  | 1262 | -C "a session has been resumed" | 
|  | 1263 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1264 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1265 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 1266 | "$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] | 1267 | 0 \ | 
|  | 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 cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1274 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1275 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1276 | $O_CLI -sess_in $SESSION; \ | 
|  | 1277 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1278 | 0 \ | 
|  | 1279 | -s "found session ticket extension" \ | 
|  | 1280 | -S "server hello, adding session ticket extension" \ | 
|  | 1281 | -s "session successfully restored from cache" \ | 
|  | 1282 | -S "session successfully restored from ticket" \ | 
|  | 1283 | -s "a session has been resumed" | 
|  | 1284 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1285 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1286 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1287 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1288 | 0 \ | 
|  | 1289 | -C "found session_ticket extension" \ | 
|  | 1290 | -C "parse new session ticket" \ | 
|  | 1291 | -c "a session has been resumed" | 
|  | 1292 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1293 | # Tests for Max Fragment Length extension | 
|  | 1294 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1295 | run_test    "Max fragment length: not used, reference" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1296 | "$P_SRV debug_level=3" \ | 
|  | 1297 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1298 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1299 | -c "Maximum fragment length is 16384" \ | 
|  | 1300 | -s "Maximum fragment length is 16384" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1301 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1302 | -S "found max fragment length extension" \ | 
|  | 1303 | -S "server hello, max_fragment_length extension" \ | 
|  | 1304 | -C "found max_fragment_length extension" | 
|  | 1305 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1306 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1307 | "$P_SRV debug_level=3" \ | 
|  | 1308 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1309 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1310 | -c "Maximum fragment length is 4096" \ | 
|  | 1311 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1312 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1313 | -s "found max fragment length extension" \ | 
|  | 1314 | -s "server hello, max_fragment_length extension" \ | 
|  | 1315 | -c "found max_fragment_length extension" | 
|  | 1316 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1317 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1318 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 1319 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1320 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1321 | -c "Maximum fragment length is 16384" \ | 
|  | 1322 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1323 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1324 | -S "found max fragment length extension" \ | 
|  | 1325 | -S "server hello, max_fragment_length extension" \ | 
|  | 1326 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1327 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1328 | requires_gnutls | 
|  | 1329 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1330 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1331 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1332 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1333 | -c "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1334 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1335 | -c "found max_fragment_length extension" | 
|  | 1336 |  | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1337 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 1338 | "$P_SRV debug_level=3" \ | 
|  | 1339 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 1340 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1341 | -c "Maximum fragment length is 2048" \ | 
|  | 1342 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1343 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1344 | -s "found max fragment length extension" \ | 
|  | 1345 | -s "server hello, max_fragment_length extension" \ | 
|  | 1346 | -c "found max_fragment_length extension" \ | 
|  | 1347 | -c "2048 bytes written in 1 fragments" \ | 
|  | 1348 | -s "2048 bytes read" | 
|  | 1349 |  | 
|  | 1350 | run_test    "Max fragment length: client, larger message" \ | 
|  | 1351 | "$P_SRV debug_level=3" \ | 
|  | 1352 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 1353 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1354 | -c "Maximum fragment length is 2048" \ | 
|  | 1355 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1356 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1357 | -s "found max fragment length extension" \ | 
|  | 1358 | -s "server hello, max_fragment_length extension" \ | 
|  | 1359 | -c "found max_fragment_length extension" \ | 
|  | 1360 | -c "2345 bytes written in 2 fragments" \ | 
|  | 1361 | -s "2048 bytes read" \ | 
|  | 1362 | -s "297 bytes read" | 
|  | 1363 |  | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1364 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1365 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 1366 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 1367 | 1 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1368 | -c "Maximum fragment length is 2048" \ | 
|  | 1369 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1370 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1371 | -s "found max fragment length extension" \ | 
|  | 1372 | -s "server hello, max_fragment_length extension" \ | 
|  | 1373 | -c "found max_fragment_length extension" \ | 
|  | 1374 | -c "fragment larger than.*maximum" | 
|  | 1375 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1376 | # Tests for renegotiation | 
|  | 1377 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1378 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1379 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1380 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1381 | 0 \ | 
|  | 1382 | -C "client hello, adding renegotiation extension" \ | 
|  | 1383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1384 | -S "found renegotiation extension" \ | 
|  | 1385 | -s "server hello, secure renegotiation extension" \ | 
|  | 1386 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1387 | -C "=> renegotiate" \ | 
|  | 1388 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1389 | -S "write hello request" | 
|  | 1390 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1391 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1392 | "$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] | 1393 | "$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] | 1394 | 0 \ | 
|  | 1395 | -c "client hello, adding renegotiation extension" \ | 
|  | 1396 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1397 | -s "found renegotiation extension" \ | 
|  | 1398 | -s "server hello, secure renegotiation extension" \ | 
|  | 1399 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1400 | -c "=> renegotiate" \ | 
|  | 1401 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1402 | -S "write hello request" | 
|  | 1403 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1404 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1405 | "$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] | 1406 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1407 | 0 \ | 
|  | 1408 | -c "client hello, adding renegotiation extension" \ | 
|  | 1409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1410 | -s "found renegotiation extension" \ | 
|  | 1411 | -s "server hello, secure renegotiation extension" \ | 
|  | 1412 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1413 | -c "=> renegotiate" \ | 
|  | 1414 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1415 | -s "write hello request" | 
|  | 1416 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1417 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1418 | "$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] | 1419 | "$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] | 1420 | 0 \ | 
|  | 1421 | -c "client hello, adding renegotiation extension" \ | 
|  | 1422 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1423 | -s "found renegotiation extension" \ | 
|  | 1424 | -s "server hello, secure renegotiation extension" \ | 
|  | 1425 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1426 | -c "=> renegotiate" \ | 
|  | 1427 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1428 | -s "write hello request" | 
|  | 1429 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1430 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1431 | "$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] | 1432 | "$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] | 1433 | 1 \ | 
|  | 1434 | -c "client hello, adding renegotiation extension" \ | 
|  | 1435 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1436 | -S "found renegotiation extension" \ | 
|  | 1437 | -s "server hello, secure renegotiation extension" \ | 
|  | 1438 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1439 | -c "=> renegotiate" \ | 
|  | 1440 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1441 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1442 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1443 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1444 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1445 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1446 | "$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] | 1447 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1448 | 0 \ | 
|  | 1449 | -C "client hello, adding renegotiation extension" \ | 
|  | 1450 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1451 | -S "found renegotiation extension" \ | 
|  | 1452 | -s "server hello, secure renegotiation extension" \ | 
|  | 1453 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1454 | -C "=> renegotiate" \ | 
|  | 1455 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1456 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1457 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1458 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1459 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1460 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1461 | "$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] | 1462 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1463 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1464 | 0 \ | 
|  | 1465 | -C "client hello, adding renegotiation extension" \ | 
|  | 1466 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1467 | -S "found renegotiation extension" \ | 
|  | 1468 | -s "server hello, secure renegotiation extension" \ | 
|  | 1469 | -c "found renegotiation extension" \ | 
|  | 1470 | -C "=> renegotiate" \ | 
|  | 1471 | -S "=> renegotiate" \ | 
|  | 1472 | -s "write hello request" \ | 
|  | 1473 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1474 | -S "failed" | 
|  | 1475 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1476 | # delay 2 for 1 alert record + 1 application data record | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1477 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1478 | "$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] | 1479 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1480 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1481 | 0 \ | 
|  | 1482 | -C "client hello, adding renegotiation extension" \ | 
|  | 1483 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1484 | -S "found renegotiation extension" \ | 
|  | 1485 | -s "server hello, secure renegotiation extension" \ | 
|  | 1486 | -c "found renegotiation extension" \ | 
|  | 1487 | -C "=> renegotiate" \ | 
|  | 1488 | -S "=> renegotiate" \ | 
|  | 1489 | -s "write hello request" \ | 
|  | 1490 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1491 | -S "failed" | 
|  | 1492 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1493 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1494 | "$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] | 1495 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1496 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1497 | 0 \ | 
|  | 1498 | -C "client hello, adding renegotiation extension" \ | 
|  | 1499 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1500 | -S "found renegotiation extension" \ | 
|  | 1501 | -s "server hello, secure renegotiation extension" \ | 
|  | 1502 | -c "found renegotiation extension" \ | 
|  | 1503 | -C "=> renegotiate" \ | 
|  | 1504 | -S "=> renegotiate" \ | 
|  | 1505 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1506 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1507 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1508 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1509 | "$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] | 1510 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1511 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1512 | 0 \ | 
|  | 1513 | -c "client hello, adding renegotiation extension" \ | 
|  | 1514 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1515 | -s "found renegotiation extension" \ | 
|  | 1516 | -s "server hello, secure renegotiation extension" \ | 
|  | 1517 | -c "found renegotiation extension" \ | 
|  | 1518 | -c "=> renegotiate" \ | 
|  | 1519 | -s "=> renegotiate" \ | 
|  | 1520 | -s "write hello request" \ | 
|  | 1521 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1522 | -S "failed" | 
|  | 1523 |  | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1524 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1525 | "$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] | 1526 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 1527 | 0 \ | 
|  | 1528 | -C "client hello, adding renegotiation extension" \ | 
|  | 1529 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1530 | -S "found renegotiation extension" \ | 
|  | 1531 | -s "server hello, secure renegotiation extension" \ | 
|  | 1532 | -c "found renegotiation extension" \ | 
|  | 1533 | -S "record counter limit reached: renegotiate" \ | 
|  | 1534 | -C "=> renegotiate" \ | 
|  | 1535 | -S "=> renegotiate" \ | 
|  | 1536 | -S "write hello request" \ | 
|  | 1537 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1538 | -S "failed" | 
|  | 1539 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1540 | # one extra exchange to be able to complete renego | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1541 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1542 | "$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] | 1543 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1544 | 0 \ | 
|  | 1545 | -c "client hello, adding renegotiation extension" \ | 
|  | 1546 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1547 | -s "found renegotiation extension" \ | 
|  | 1548 | -s "server hello, secure renegotiation extension" \ | 
|  | 1549 | -c "found renegotiation extension" \ | 
|  | 1550 | -s "record counter limit reached: renegotiate" \ | 
|  | 1551 | -c "=> renegotiate" \ | 
|  | 1552 | -s "=> renegotiate" \ | 
|  | 1553 | -s "write hello request" \ | 
|  | 1554 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1555 | -S "failed" | 
|  | 1556 |  | 
|  | 1557 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1558 | "$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] | 1559 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1560 | 0 \ | 
|  | 1561 | -c "client hello, adding renegotiation extension" \ | 
|  | 1562 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1563 | -s "found renegotiation extension" \ | 
|  | 1564 | -s "server hello, secure renegotiation extension" \ | 
|  | 1565 | -c "found renegotiation extension" \ | 
|  | 1566 | -s "record counter limit reached: renegotiate" \ | 
|  | 1567 | -c "=> renegotiate" \ | 
|  | 1568 | -s "=> renegotiate" \ | 
|  | 1569 | -s "write hello request" \ | 
|  | 1570 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1571 | -S "failed" | 
|  | 1572 |  | 
|  | 1573 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1574 | "$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] | 1575 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 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" \ | 
|  | 1582 | -S "record counter limit reached: renegotiate" \ | 
|  | 1583 | -C "=> renegotiate" \ | 
|  | 1584 | -S "=> renegotiate" \ | 
|  | 1585 | -S "write hello request" \ | 
|  | 1586 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1587 | -S "failed" | 
|  | 1588 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1589 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1590 | "$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] | 1591 | "$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] | 1592 | 0 \ | 
|  | 1593 | -c "client hello, adding renegotiation extension" \ | 
|  | 1594 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1595 | -s "found renegotiation extension" \ | 
|  | 1596 | -s "server hello, secure renegotiation extension" \ | 
|  | 1597 | -c "found renegotiation extension" \ | 
|  | 1598 | -c "=> renegotiate" \ | 
|  | 1599 | -s "=> renegotiate" \ | 
|  | 1600 | -S "write hello request" | 
|  | 1601 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1602 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1603 | "$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] | 1604 | "$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] | 1605 | 0 \ | 
|  | 1606 | -c "client hello, adding renegotiation extension" \ | 
|  | 1607 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1608 | -s "found renegotiation extension" \ | 
|  | 1609 | -s "server hello, secure renegotiation extension" \ | 
|  | 1610 | -c "found renegotiation extension" \ | 
|  | 1611 | -c "=> renegotiate" \ | 
|  | 1612 | -s "=> renegotiate" \ | 
|  | 1613 | -s "write hello request" | 
|  | 1614 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1615 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1616 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1617 | "$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] | 1618 | 0 \ | 
|  | 1619 | -c "client hello, adding renegotiation extension" \ | 
|  | 1620 | -c "found renegotiation extension" \ | 
|  | 1621 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1622 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1623 | -C "error" \ | 
|  | 1624 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1625 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1626 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1627 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 1628 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1629 | "$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] | 1630 | 0 \ | 
|  | 1631 | -c "client hello, adding renegotiation extension" \ | 
|  | 1632 | -c "found renegotiation extension" \ | 
|  | 1633 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1634 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1635 | -C "error" \ | 
|  | 1636 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1637 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1638 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1639 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 1640 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1641 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 1642 | 1 \ | 
|  | 1643 | -c "client hello, adding renegotiation extension" \ | 
|  | 1644 | -C "found renegotiation extension" \ | 
|  | 1645 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1646 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1647 | -c "error" \ | 
|  | 1648 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1649 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1650 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1651 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 1652 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1653 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 1654 | allow_legacy=0" \ | 
|  | 1655 | 1 \ | 
|  | 1656 | -c "client hello, adding renegotiation extension" \ | 
|  | 1657 | -C "found renegotiation extension" \ | 
|  | 1658 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1659 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1660 | -c "error" \ | 
|  | 1661 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1662 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1663 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1664 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 1665 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1666 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 1667 | allow_legacy=1" \ | 
|  | 1668 | 0 \ | 
|  | 1669 | -c "client hello, adding renegotiation extension" \ | 
|  | 1670 | -C "found renegotiation extension" \ | 
|  | 1671 | -c "=> renegotiate" \ | 
|  | 1672 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1673 | -C "error" \ | 
|  | 1674 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1675 |  | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 1676 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 1677 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 1678 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 1679 | 0 \ | 
|  | 1680 | -c "client hello, adding renegotiation extension" \ | 
|  | 1681 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1682 | -s "found renegotiation extension" \ | 
|  | 1683 | -s "server hello, secure renegotiation extension" \ | 
|  | 1684 | -c "found renegotiation extension" \ | 
|  | 1685 | -c "=> renegotiate" \ | 
|  | 1686 | -s "=> renegotiate" \ | 
|  | 1687 | -S "write hello request" | 
|  | 1688 |  | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1689 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 1690 | "$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] | 1691 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 1692 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 1693 | 0 \ | 
|  | 1694 | -c "client hello, adding renegotiation extension" \ | 
|  | 1695 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1696 | -s "found renegotiation extension" \ | 
|  | 1697 | -s "server hello, secure renegotiation extension" \ | 
|  | 1698 | -c "found renegotiation extension" \ | 
|  | 1699 | -c "=> renegotiate" \ | 
|  | 1700 | -s "=> renegotiate" \ | 
|  | 1701 | -s "write hello request" | 
|  | 1702 |  | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 1703 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 1704 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 1705 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 1706 | 0 \ | 
|  | 1707 | -c "client hello, adding renegotiation extension" \ | 
|  | 1708 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1709 | -s "found renegotiation extension" \ | 
|  | 1710 | -s "server hello, secure renegotiation extension" \ | 
|  | 1711 | -s "record counter limit reached: renegotiate" \ | 
|  | 1712 | -c "=> renegotiate" \ | 
|  | 1713 | -s "=> renegotiate" \ | 
|  | 1714 | -s "write hello request" \ | 
|  | 1715 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 1716 | requires_gnutls | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1717 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 1718 | "$G_SRV -u --mtu 4096" \ | 
|  | 1719 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 1720 | 0 \ | 
|  | 1721 | -c "client hello, adding renegotiation extension" \ | 
|  | 1722 | -c "found renegotiation extension" \ | 
|  | 1723 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1724 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 1725 | -C "error" \ | 
|  | 1726 | -s "Extra-header:" | 
|  | 1727 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1728 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 1729 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1730 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1731 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 1732 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 1733 | "$P_CLI debug_level=3" \ | 
|  | 1734 | 0 \ | 
|  | 1735 | -c "found renegotiation extension" \ | 
|  | 1736 | -C "error" \ | 
|  | 1737 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1738 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1739 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1740 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 1741 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1742 | "$P_CLI debug_level=3" \ | 
|  | 1743 | 0 \ | 
|  | 1744 | -C "found renegotiation extension" \ | 
|  | 1745 | -C "error" \ | 
|  | 1746 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1747 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1748 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1749 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 1750 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1751 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 1752 | 1 \ | 
|  | 1753 | -C "found renegotiation extension" \ | 
|  | 1754 | -c "error" \ | 
|  | 1755 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 1756 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1757 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1758 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 1759 | "$P_SRV debug_level=3" \ | 
|  | 1760 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 1761 | 0 \ | 
|  | 1762 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 1763 | -s "server hello, secure renegotiation extension" | 
|  | 1764 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1765 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1766 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 1767 | "$P_SRV debug_level=3" \ | 
|  | 1768 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1769 | 0 \ | 
|  | 1770 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 1771 | -S "server hello, secure renegotiation extension" | 
|  | 1772 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1773 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1774 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 1775 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
|  | 1776 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 1777 | 1 \ | 
|  | 1778 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 1779 | -S "server hello, secure renegotiation extension" | 
|  | 1780 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 1781 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 1782 |  | 
|  | 1783 | requires_gnutls | 
|  | 1784 | run_test    "DER format: no trailing bytes" \ | 
|  | 1785 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 1786 | key_file=data_files/server5.key" \ | 
|  | 1787 | "$G_CLI " \ | 
|  | 1788 | 0 \ | 
|  | 1789 | -c "Handshake was completed" \ | 
|  | 1790 |  | 
|  | 1791 | requires_gnutls | 
|  | 1792 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 1793 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 1794 | key_file=data_files/server5.key" \ | 
|  | 1795 | "$G_CLI " \ | 
|  | 1796 | 0 \ | 
|  | 1797 | -c "Handshake was completed" \ | 
|  | 1798 |  | 
|  | 1799 | requires_gnutls | 
|  | 1800 | run_test    "DER format: with a trailing random byte" \ | 
|  | 1801 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 1802 | key_file=data_files/server5.key" \ | 
|  | 1803 | "$G_CLI " \ | 
|  | 1804 | 0 \ | 
|  | 1805 | -c "Handshake was completed" \ | 
|  | 1806 |  | 
|  | 1807 | requires_gnutls | 
|  | 1808 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 1809 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 1810 | key_file=data_files/server5.key" \ | 
|  | 1811 | "$G_CLI " \ | 
|  | 1812 | 0 \ | 
|  | 1813 | -c "Handshake was completed" \ | 
|  | 1814 |  | 
|  | 1815 | requires_gnutls | 
|  | 1816 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 1817 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 1818 | key_file=data_files/server5.key" \ | 
|  | 1819 | "$G_CLI " \ | 
|  | 1820 | 0 \ | 
|  | 1821 | -c "Handshake was completed" \ | 
|  | 1822 |  | 
|  | 1823 | requires_gnutls | 
|  | 1824 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 1825 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 1826 | key_file=data_files/server5.key" \ | 
|  | 1827 | "$G_CLI " \ | 
|  | 1828 | 0 \ | 
|  | 1829 | -c "Handshake was completed" \ | 
|  | 1830 |  | 
|  | 1831 | requires_gnutls | 
|  | 1832 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 1833 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 1834 | key_file=data_files/server5.key" \ | 
|  | 1835 | "$G_CLI " \ | 
|  | 1836 | 0 \ | 
|  | 1837 | -c "Handshake was completed" \ | 
|  | 1838 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1839 | # Tests for auth_mode | 
|  | 1840 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1841 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1842 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 1843 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1844 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1845 | 1 \ | 
|  | 1846 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1847 | -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] | 1848 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1849 | -c "X509 - Certificate verification failed" | 
|  | 1850 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1851 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1852 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 1853 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1854 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1855 | 0 \ | 
|  | 1856 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1857 | -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] | 1858 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1859 | -C "X509 - Certificate verification failed" | 
|  | 1860 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 1861 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 1862 | "$P_SRV" \ | 
|  | 1863 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 1864 | 0 \ | 
|  | 1865 | -c "x509_verify_cert() returned" \ | 
|  | 1866 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 1867 | -c "! Certificate verification flags"\ | 
|  | 1868 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 1869 | -C "X509 - Certificate verification failed" \ | 
|  | 1870 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 1871 |  | 
|  | 1872 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 1873 | "$P_SRV" \ | 
|  | 1874 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 1875 | 1 \ | 
|  | 1876 | -c "x509_verify_cert() returned" \ | 
|  | 1877 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 1878 | -c "! Certificate verification flags"\ | 
|  | 1879 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 1880 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 1881 |  | 
|  | 1882 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 1883 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 1884 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 1885 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 1886 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 1887 | # different means to have the server ignoring the client's supported curve list. | 
|  | 1888 |  | 
|  | 1889 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 1890 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 1891 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 1892 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 1893 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 1894 | 1 \ | 
|  | 1895 | -c "bad certificate (EC key curve)"\ | 
|  | 1896 | -c "! Certificate verification flags"\ | 
|  | 1897 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 1898 |  | 
|  | 1899 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 1900 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 1901 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 1902 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 1903 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 1904 | 1 \ | 
|  | 1905 | -c "bad certificate (EC key curve)"\ | 
|  | 1906 | -c "! Certificate verification flags"\ | 
|  | 1907 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 1908 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1909 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1910 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1911 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1912 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1913 | 0 \ | 
|  | 1914 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 1915 | -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] | 1916 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1917 | -C "X509 - Certificate verification failed" | 
|  | 1918 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 1919 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 1920 | "$P_SRV auth_mode=required" \ | 
|  | 1921 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 1922 | key_file=data_files/server6.key \ | 
|  | 1923 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 1924 | 0 \ | 
|  | 1925 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 1926 | -c "Supported Signature Algorithm found: 5," | 
|  | 1927 |  | 
|  | 1928 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 1929 | "$P_SRV auth_mode=required" \ | 
|  | 1930 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 1931 | key_file=data_files/server6.key \ | 
|  | 1932 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 1933 | 0 \ | 
|  | 1934 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 1935 | -c "Supported Signature Algorithm found: 5," | 
|  | 1936 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 1937 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 1938 | run_test    "Authentication: client has no cert, server required (SSLv3)" \ | 
|  | 1939 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ | 
|  | 1940 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ | 
|  | 1941 | key_file=data_files/server5.key" \ | 
|  | 1942 | 1 \ | 
|  | 1943 | -S "skip write certificate request" \ | 
|  | 1944 | -C "skip parse certificate request" \ | 
|  | 1945 | -c "got a certificate request" \ | 
|  | 1946 | -c "got no certificate to send" \ | 
|  | 1947 | -S "x509_verify_cert() returned" \ | 
|  | 1948 | -s "client has no certificate" \ | 
|  | 1949 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 1950 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 1951 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 1952 |  | 
|  | 1953 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 1954 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 1955 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 1956 | key_file=data_files/server5.key" \ | 
|  | 1957 | 1 \ | 
|  | 1958 | -S "skip write certificate request" \ | 
|  | 1959 | -C "skip parse certificate request" \ | 
|  | 1960 | -c "got a certificate request" \ | 
|  | 1961 | -c "= write certificate$" \ | 
|  | 1962 | -C "skip write certificate$" \ | 
|  | 1963 | -S "x509_verify_cert() returned" \ | 
|  | 1964 | -s "client has no certificate" \ | 
|  | 1965 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 1966 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 1967 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 1968 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1969 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1970 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 1971 | "$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] | 1972 | key_file=data_files/server5.key" \ | 
|  | 1973 | 1 \ | 
|  | 1974 | -S "skip write certificate request" \ | 
|  | 1975 | -C "skip parse certificate request" \ | 
|  | 1976 | -c "got a certificate request" \ | 
|  | 1977 | -C "skip write certificate" \ | 
|  | 1978 | -C "skip write certificate verify" \ | 
|  | 1979 | -S "skip parse certificate verify" \ | 
|  | 1980 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 1981 | -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] | 1982 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 1983 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1984 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1985 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 1986 | # We don't check that the client receives the alert because it might | 
|  | 1987 | # detect that its write end of the connection is closed and abort | 
|  | 1988 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1989 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 1990 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 1991 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 1992 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 1993 | key_file=data_files/server5.key" \ | 
|  | 1994 | 1 \ | 
|  | 1995 | -S "skip write certificate request" \ | 
|  | 1996 | -C "skip parse certificate request" \ | 
|  | 1997 | -c "got a certificate request" \ | 
|  | 1998 | -C "skip write certificate" \ | 
|  | 1999 | -C "skip write certificate verify" \ | 
|  | 2000 | -S "skip parse certificate verify" \ | 
|  | 2001 | -s "x509_verify_cert() returned" \ | 
|  | 2002 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2003 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2004 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2005 | -s "X509 - Certificate verification failed" | 
|  | 2006 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2007 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2008 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2009 | "$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] | 2010 | key_file=data_files/server5.key" \ | 
|  | 2011 | 0 \ | 
|  | 2012 | -S "skip write certificate request" \ | 
|  | 2013 | -C "skip parse certificate request" \ | 
|  | 2014 | -c "got a certificate request" \ | 
|  | 2015 | -C "skip write certificate" \ | 
|  | 2016 | -C "skip write certificate verify" \ | 
|  | 2017 | -S "skip parse certificate verify" \ | 
|  | 2018 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2019 | -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] | 2020 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2021 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2022 | -S "X509 - Certificate verification failed" | 
|  | 2023 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2024 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2025 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 2026 | "$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] | 2027 | key_file=data_files/server5.key" \ | 
|  | 2028 | 0 \ | 
|  | 2029 | -s "skip write certificate request" \ | 
|  | 2030 | -C "skip parse certificate request" \ | 
|  | 2031 | -c "got no certificate request" \ | 
|  | 2032 | -c "skip write certificate" \ | 
|  | 2033 | -c "skip write certificate verify" \ | 
|  | 2034 | -s "skip parse certificate verify" \ | 
|  | 2035 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2036 | -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] | 2037 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2038 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2039 | -S "X509 - Certificate verification failed" | 
|  | 2040 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2041 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2042 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2043 | "$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] | 2044 | 0 \ | 
|  | 2045 | -S "skip write certificate request" \ | 
|  | 2046 | -C "skip parse certificate request" \ | 
|  | 2047 | -c "got a certificate request" \ | 
|  | 2048 | -C "skip write certificate$" \ | 
|  | 2049 | -C "got no certificate to send" \ | 
|  | 2050 | -S "SSLv3 client has no certificate" \ | 
|  | 2051 | -c "skip write certificate verify" \ | 
|  | 2052 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2053 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2054 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2055 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2056 | -S "X509 - Certificate verification failed" | 
|  | 2057 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2058 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2059 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2060 | "$O_CLI" \ | 
|  | 2061 | 0 \ | 
|  | 2062 | -S "skip write certificate request" \ | 
|  | 2063 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2064 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2065 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2066 | -S "X509 - Certificate verification failed" | 
|  | 2067 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2068 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2069 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2070 | "$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] | 2071 | 0 \ | 
|  | 2072 | -C "skip parse certificate request" \ | 
|  | 2073 | -c "got a certificate request" \ | 
|  | 2074 | -C "skip write certificate$" \ | 
|  | 2075 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2076 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2077 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2078 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 2079 | "$O_SRV -Verify 10" \ | 
|  | 2080 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 2081 | 1 \ | 
|  | 2082 | -C "skip parse certificate request" \ | 
|  | 2083 | -c "got a certificate request" \ | 
|  | 2084 | -C "skip write certificate$" \ | 
|  | 2085 | -c "skip write certificate verify" \ | 
|  | 2086 | -c "! mbedtls_ssl_handshake returned" | 
|  | 2087 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2089 | run_test    "Authentication: client no cert, ssl3" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2090 | "$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] | 2091 | "$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] | 2092 | 0 \ | 
|  | 2093 | -S "skip write certificate request" \ | 
|  | 2094 | -C "skip parse certificate request" \ | 
|  | 2095 | -c "got a certificate request" \ | 
|  | 2096 | -C "skip write certificate$" \ | 
|  | 2097 | -c "skip write certificate verify" \ | 
|  | 2098 | -c "got no certificate to send" \ | 
|  | 2099 | -s "SSLv3 client has no certificate" \ | 
|  | 2100 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2101 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2102 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2103 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2104 | -S "X509 - Certificate verification failed" | 
|  | 2105 |  | 
| Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2106 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its | 
|  | 2107 | # default value (8) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2108 |  | 
| Simon Butcher | f145a9d | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2109 | MAX_IM_CA='8' | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2110 | 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] | 2111 |  | 
| Simon Butcher | f145a9d | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2112 | 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] | 2113 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" | 
| Simon Butcher | f145a9d | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2114 | 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] | 2115 | printf "test value of ${MAX_IM_CA}. \n" | 
|  | 2116 | printf "\n" | 
| Simon Butcher | f145a9d | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2117 | printf "The tests assume this value and if it changes, the tests in this\n" | 
|  | 2118 | printf "script should also be adjusted.\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2119 | printf "\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2120 |  | 
|  | 2121 | exit 1 | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2122 | fi | 
|  | 2123 |  | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2124 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 2125 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2126 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2127 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2128 | 0 \ | 
|  | 2129 | -C "X509 - A fatal error occured" | 
|  | 2130 |  | 
|  | 2131 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 2132 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2133 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2134 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2135 | 1 \ | 
|  | 2136 | -c "X509 - A fatal error occured" | 
|  | 2137 |  | 
|  | 2138 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 2139 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2140 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2141 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2142 | auth_mode=optional" \ | 
|  | 2143 | 1 \ | 
|  | 2144 | -c "X509 - A fatal error occured" | 
|  | 2145 |  | 
|  | 2146 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 2147 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2148 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2149 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2150 | auth_mode=none" \ | 
|  | 2151 | 0 \ | 
|  | 2152 | -C "X509 - A fatal error occured" | 
|  | 2153 |  | 
|  | 2154 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 2155 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2156 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2157 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2158 | 0 \ | 
|  | 2159 | -S "X509 - A fatal error occured" | 
|  | 2160 |  | 
|  | 2161 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 2162 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 2163 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2164 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2165 | 1 \ | 
|  | 2166 | -s "X509 - A fatal error occured" | 
|  | 2167 |  | 
|  | 2168 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 2169 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2170 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2171 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2172 | 1 \ | 
|  | 2173 | -s "X509 - A fatal error occured" | 
|  | 2174 |  | 
|  | 2175 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 2176 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2177 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2178 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2179 | 0 \ | 
|  | 2180 | -S "X509 - A fatal error occured" | 
|  | 2181 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2182 | # Tests for CA list in CertificateRequest messages | 
|  | 2183 |  | 
|  | 2184 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 2185 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2186 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2187 | key_file=data_files/server6.key" \ | 
|  | 2188 | 0 \ | 
|  | 2189 | -s "requested DN" | 
|  | 2190 |  | 
|  | 2191 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 2192 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2193 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2194 | key_file=data_files/server6.key" \ | 
|  | 2195 | 0 \ | 
|  | 2196 | -S "requested DN" | 
|  | 2197 |  | 
|  | 2198 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 2199 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2200 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 2201 | key_file=data_files/server5.key" \ | 
|  | 2202 | 1 \ | 
|  | 2203 | -S "requested DN" \ | 
|  | 2204 | -s "x509_verify_cert() returned" \ | 
|  | 2205 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2206 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2207 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2208 | -s "X509 - Certificate verification failed" | 
|  | 2209 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2210 | # Tests for certificate selection based on SHA verson | 
|  | 2211 |  | 
|  | 2212 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 2213 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2214 | key_file=data_files/server5.key \ | 
|  | 2215 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2216 | key_file2=data_files/server5.key" \ | 
|  | 2217 | "$P_CLI force_version=tls1_2" \ | 
|  | 2218 | 0 \ | 
|  | 2219 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2220 | -C "signed using.*ECDSA with SHA1" | 
|  | 2221 |  | 
|  | 2222 | run_test    "Certificate hash: client TLS 1.1 -> SHA-1" \ | 
|  | 2223 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2224 | key_file=data_files/server5.key \ | 
|  | 2225 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2226 | key_file2=data_files/server5.key" \ | 
|  | 2227 | "$P_CLI force_version=tls1_1" \ | 
|  | 2228 | 0 \ | 
|  | 2229 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2230 | -c "signed using.*ECDSA with SHA1" | 
|  | 2231 |  | 
|  | 2232 | run_test    "Certificate hash: client TLS 1.0 -> SHA-1" \ | 
|  | 2233 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2234 | key_file=data_files/server5.key \ | 
|  | 2235 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2236 | key_file2=data_files/server5.key" \ | 
|  | 2237 | "$P_CLI force_version=tls1" \ | 
|  | 2238 | 0 \ | 
|  | 2239 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2240 | -c "signed using.*ECDSA with SHA1" | 
|  | 2241 |  | 
|  | 2242 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ | 
|  | 2243 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2244 | key_file=data_files/server5.key \ | 
|  | 2245 | crt_file2=data_files/server6.crt \ | 
|  | 2246 | key_file2=data_files/server6.key" \ | 
|  | 2247 | "$P_CLI force_version=tls1_1" \ | 
|  | 2248 | 0 \ | 
|  | 2249 | -c "serial number.*09" \ | 
|  | 2250 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2251 | -C "signed using.*ECDSA with SHA1" | 
|  | 2252 |  | 
|  | 2253 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ | 
|  | 2254 | "$P_SRV crt_file=data_files/server6.crt \ | 
|  | 2255 | key_file=data_files/server6.key \ | 
|  | 2256 | crt_file2=data_files/server5.crt \ | 
|  | 2257 | key_file2=data_files/server5.key" \ | 
|  | 2258 | "$P_CLI force_version=tls1_1" \ | 
|  | 2259 | 0 \ | 
|  | 2260 | -c "serial number.*0A" \ | 
|  | 2261 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2262 | -C "signed using.*ECDSA with SHA1" | 
|  | 2263 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2264 | # tests for SNI | 
|  | 2265 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2266 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2267 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2268 | 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] | 2269 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2270 | 0 \ | 
|  | 2271 | -S "parse ServerName extension" \ | 
|  | 2272 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 2273 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2274 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2275 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2276 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2277 | 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] | 2278 | 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] | 2279 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2280 | 0 \ | 
|  | 2281 | -s "parse ServerName extension" \ | 
|  | 2282 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2283 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2284 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2285 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2286 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2287 | 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] | 2288 | 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] | 2289 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2290 | 0 \ | 
|  | 2291 | -s "parse ServerName extension" \ | 
|  | 2292 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2293 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2294 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2295 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2296 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2297 | 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] | 2298 | 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] | 2299 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2300 | 1 \ | 
|  | 2301 | -s "parse ServerName extension" \ | 
|  | 2302 | -s "ssl_sni_wrapper() returned" \ | 
|  | 2303 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2304 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 2305 | -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] | 2306 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2307 | run_test    "SNI: client auth no override: optional" \ | 
|  | 2308 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2309 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2310 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 2311 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2312 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2313 | -S "skip write certificate request" \ | 
|  | 2314 | -C "skip parse certificate request" \ | 
|  | 2315 | -c "got a certificate request" \ | 
|  | 2316 | -C "skip write certificate" \ | 
|  | 2317 | -C "skip write certificate verify" \ | 
|  | 2318 | -S "skip parse certificate verify" | 
|  | 2319 |  | 
|  | 2320 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 2321 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 2322 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2323 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 2324 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2325 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2326 | -S "skip write certificate request" \ | 
|  | 2327 | -C "skip parse certificate request" \ | 
|  | 2328 | -c "got a certificate request" \ | 
|  | 2329 | -C "skip write certificate" \ | 
|  | 2330 | -C "skip write certificate verify" \ | 
|  | 2331 | -S "skip parse certificate verify" | 
|  | 2332 |  | 
|  | 2333 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 2334 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2335 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2336 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 2337 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2338 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2339 | -s "skip write certificate request" \ | 
|  | 2340 | -C "skip parse certificate request" \ | 
|  | 2341 | -c "got no certificate request" \ | 
|  | 2342 | -c "skip write certificate" \ | 
|  | 2343 | -c "skip write certificate verify" \ | 
|  | 2344 | -s "skip parse certificate verify" | 
|  | 2345 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2346 | run_test    "SNI: CA no override" \ | 
|  | 2347 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2348 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2349 | ca_file=data_files/test-ca.crt \ | 
|  | 2350 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 2351 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2352 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2353 | 1 \ | 
|  | 2354 | -S "skip write certificate request" \ | 
|  | 2355 | -C "skip parse certificate request" \ | 
|  | 2356 | -c "got a certificate request" \ | 
|  | 2357 | -C "skip write certificate" \ | 
|  | 2358 | -C "skip write certificate verify" \ | 
|  | 2359 | -S "skip parse certificate verify" \ | 
|  | 2360 | -s "x509_verify_cert() returned" \ | 
|  | 2361 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2362 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2363 |  | 
|  | 2364 | run_test    "SNI: CA override" \ | 
|  | 2365 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2366 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2367 | ca_file=data_files/test-ca.crt \ | 
|  | 2368 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 2369 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2370 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2371 | 0 \ | 
|  | 2372 | -S "skip write certificate request" \ | 
|  | 2373 | -C "skip parse certificate request" \ | 
|  | 2374 | -c "got a certificate request" \ | 
|  | 2375 | -C "skip write certificate" \ | 
|  | 2376 | -C "skip write certificate verify" \ | 
|  | 2377 | -S "skip parse certificate verify" \ | 
|  | 2378 | -S "x509_verify_cert() returned" \ | 
|  | 2379 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2380 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2381 |  | 
|  | 2382 | run_test    "SNI: CA override with CRL" \ | 
|  | 2383 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2384 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2385 | ca_file=data_files/test-ca.crt \ | 
|  | 2386 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 2387 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2388 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2389 | 1 \ | 
|  | 2390 | -S "skip write certificate request" \ | 
|  | 2391 | -C "skip parse certificate request" \ | 
|  | 2392 | -c "got a certificate request" \ | 
|  | 2393 | -C "skip write certificate" \ | 
|  | 2394 | -C "skip write certificate verify" \ | 
|  | 2395 | -S "skip parse certificate verify" \ | 
|  | 2396 | -s "x509_verify_cert() returned" \ | 
|  | 2397 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2398 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 2399 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2400 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 2401 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2402 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2403 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 2404 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2405 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2406 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2407 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2408 | -c "Read from server: .* bytes read" | 
|  | 2409 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2410 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2411 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 2412 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2413 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2414 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2415 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2416 | -c "Read from server: .* bytes read" | 
|  | 2417 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2418 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2419 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 2420 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 2421 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2422 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2423 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2424 | -c "Read from server: .* bytes read" | 
|  | 2425 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2426 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2427 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 2428 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 2429 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2430 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2431 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2432 | -c "Read from server: .* bytes read" | 
|  | 2433 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2434 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2435 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 2436 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 2437 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2438 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2439 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2440 | -c "Read from server: .* bytes read" | 
|  | 2441 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2442 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2443 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 2444 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 2445 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2446 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2447 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2448 | -c "Read from server: .* bytes read" | 
|  | 2449 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2450 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2451 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 2452 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 2453 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2454 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2455 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2456 | -c "Read from server: .* bytes read" | 
|  | 2457 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2458 | # Tests for version negotiation | 
|  | 2459 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2460 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2461 | "$P_SRV" \ | 
|  | 2462 | "$P_CLI" \ | 
|  | 2463 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2464 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2465 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2466 | -s "Protocol is TLSv1.2" \ | 
|  | 2467 | -c "Protocol is TLSv1.2" | 
|  | 2468 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2469 | run_test    "Version check: cli max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2470 | "$P_SRV" \ | 
|  | 2471 | "$P_CLI max_version=tls1_1" \ | 
|  | 2472 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2473 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2474 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2475 | -s "Protocol is TLSv1.1" \ | 
|  | 2476 | -c "Protocol is TLSv1.1" | 
|  | 2477 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2478 | run_test    "Version check: srv max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2479 | "$P_SRV max_version=tls1_1" \ | 
|  | 2480 | "$P_CLI" \ | 
|  | 2481 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2482 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2483 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2484 | -s "Protocol is TLSv1.1" \ | 
|  | 2485 | -c "Protocol is TLSv1.1" | 
|  | 2486 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2487 | 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] | 2488 | "$P_SRV max_version=tls1_1" \ | 
|  | 2489 | "$P_CLI max_version=tls1_1" \ | 
|  | 2490 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2491 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2492 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2493 | -s "Protocol is TLSv1.1" \ | 
|  | 2494 | -c "Protocol is TLSv1.1" | 
|  | 2495 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2496 | 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] | 2497 | "$P_SRV min_version=tls1_1" \ | 
|  | 2498 | "$P_CLI max_version=tls1_1" \ | 
|  | 2499 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2500 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2501 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2502 | -s "Protocol is TLSv1.1" \ | 
|  | 2503 | -c "Protocol is TLSv1.1" | 
|  | 2504 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2505 | 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] | 2506 | "$P_SRV max_version=tls1_1" \ | 
|  | 2507 | "$P_CLI min_version=tls1_1" \ | 
|  | 2508 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2509 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2510 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2511 | -s "Protocol is TLSv1.1" \ | 
|  | 2512 | -c "Protocol is TLSv1.1" | 
|  | 2513 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2514 | 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] | 2515 | "$P_SRV max_version=tls1_1" \ | 
|  | 2516 | "$P_CLI min_version=tls1_2" \ | 
|  | 2517 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2518 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2519 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2520 | -c "SSL - Handshake protocol not within min/max boundaries" | 
|  | 2521 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2522 | 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] | 2523 | "$P_SRV min_version=tls1_2" \ | 
|  | 2524 | "$P_CLI max_version=tls1_1" \ | 
|  | 2525 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2526 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2527 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2528 | -s "SSL - Handshake protocol not within min/max boundaries" | 
|  | 2529 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2530 | # Tests for ALPN extension | 
|  | 2531 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2532 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2533 | "$P_SRV debug_level=3" \ | 
|  | 2534 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2535 | 0 \ | 
|  | 2536 | -C "client hello, adding alpn extension" \ | 
|  | 2537 | -S "found alpn extension" \ | 
|  | 2538 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2539 | -S "server hello, adding alpn extension" \ | 
|  | 2540 | -C "found alpn extension " \ | 
|  | 2541 | -C "Application Layer Protocol is" \ | 
|  | 2542 | -S "Application Layer Protocol is" | 
|  | 2543 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2544 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2545 | "$P_SRV debug_level=3" \ | 
|  | 2546 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2547 | 0 \ | 
|  | 2548 | -c "client hello, adding alpn extension" \ | 
|  | 2549 | -s "found alpn extension" \ | 
|  | 2550 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2551 | -S "server hello, adding alpn extension" \ | 
|  | 2552 | -C "found alpn extension " \ | 
|  | 2553 | -c "Application Layer Protocol is (none)" \ | 
|  | 2554 | -S "Application Layer Protocol is" | 
|  | 2555 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2556 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2557 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2558 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2559 | 0 \ | 
|  | 2560 | -C "client hello, adding alpn extension" \ | 
|  | 2561 | -S "found alpn extension" \ | 
|  | 2562 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2563 | -S "server hello, adding alpn extension" \ | 
|  | 2564 | -C "found alpn extension " \ | 
|  | 2565 | -C "Application Layer Protocol is" \ | 
|  | 2566 | -s "Application Layer Protocol is (none)" | 
|  | 2567 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2568 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2570 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2571 | 0 \ | 
|  | 2572 | -c "client hello, adding alpn extension" \ | 
|  | 2573 | -s "found alpn extension" \ | 
|  | 2574 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2575 | -s "server hello, adding alpn extension" \ | 
|  | 2576 | -c "found alpn extension" \ | 
|  | 2577 | -c "Application Layer Protocol is abc" \ | 
|  | 2578 | -s "Application Layer Protocol is abc" | 
|  | 2579 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2580 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2581 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2582 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2583 | 0 \ | 
|  | 2584 | -c "client hello, adding alpn extension" \ | 
|  | 2585 | -s "found alpn extension" \ | 
|  | 2586 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2587 | -s "server hello, adding alpn extension" \ | 
|  | 2588 | -c "found alpn extension" \ | 
|  | 2589 | -c "Application Layer Protocol is abc" \ | 
|  | 2590 | -s "Application Layer Protocol is abc" | 
|  | 2591 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2592 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2593 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 2594 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2595 | 0 \ | 
|  | 2596 | -c "client hello, adding alpn extension" \ | 
|  | 2597 | -s "found alpn extension" \ | 
|  | 2598 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 2599 | -s "server hello, adding alpn extension" \ | 
|  | 2600 | -c "found alpn extension" \ | 
|  | 2601 | -c "Application Layer Protocol is 1234" \ | 
|  | 2602 | -s "Application Layer Protocol is 1234" | 
|  | 2603 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2604 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2605 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 2606 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2607 | 1 \ | 
|  | 2608 | -c "client hello, adding alpn extension" \ | 
|  | 2609 | -s "found alpn extension" \ | 
|  | 2610 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 2611 | -S "server hello, adding alpn extension" \ | 
|  | 2612 | -C "found alpn extension" \ | 
|  | 2613 | -C "Application Layer Protocol is 1234" \ | 
|  | 2614 | -S "Application Layer Protocol is 1234" | 
|  | 2615 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2616 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2617 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 2618 | # server-side certificate/suite selection | 
|  | 2619 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2620 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2621 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 2622 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 2623 | "$P_CLI" \ | 
|  | 2624 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2625 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2626 |  | 
|  | 2627 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2628 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2629 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 2630 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 2631 | "$P_CLI" \ | 
|  | 2632 | 0 \ | 
|  | 2633 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 2634 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2635 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2636 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2637 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2638 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2639 | 1 \ | 
|  | 2640 | -C "Ciphersuite is " | 
|  | 2641 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2642 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2643 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 2644 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 2645 | "$P_CLI" \ | 
|  | 2646 | 0 \ | 
|  | 2647 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 2648 |  | 
|  | 2649 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2650 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2651 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 2652 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 2653 | "$P_CLI" \ | 
|  | 2654 | 0 \ | 
|  | 2655 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 2656 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2657 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2658 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2659 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2660 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2661 | 1 \ | 
|  | 2662 | -C "Ciphersuite is " | 
|  | 2663 |  | 
|  | 2664 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2665 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2666 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2667 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2668 | "$O_SRV -key data_files/server2.key \ | 
|  | 2669 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2670 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2671 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2672 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2673 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2674 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2675 | -c "Ciphersuite is TLS-" | 
|  | 2676 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2677 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2678 | "$O_SRV -key data_files/server2.key \ | 
|  | 2679 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2680 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2681 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2682 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2683 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2684 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2685 | -c "Ciphersuite is TLS-" | 
|  | 2686 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2687 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2688 | "$O_SRV -key data_files/server2.key \ | 
|  | 2689 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2690 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2691 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2692 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2693 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2694 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2695 | -c "Ciphersuite is TLS-" | 
|  | 2696 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2697 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2698 | "$O_SRV -key data_files/server2.key \ | 
|  | 2699 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2700 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2701 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2702 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2703 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2704 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 2705 | -C "Ciphersuite is TLS-" | 
|  | 2706 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2707 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 2708 | "$O_SRV -key data_files/server2.key \ | 
|  | 2709 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 2710 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 2711 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2712 | 0 \ | 
|  | 2713 | -c "bad certificate (usage extensions)" \ | 
|  | 2714 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2715 | -c "Ciphersuite is TLS-" \ | 
|  | 2716 | -c "! Usage does not match the keyUsage extension" | 
|  | 2717 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2718 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2719 | "$O_SRV -key data_files/server2.key \ | 
|  | 2720 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2721 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2722 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2723 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2724 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2725 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2726 | -c "Ciphersuite is TLS-" | 
|  | 2727 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2728 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2729 | "$O_SRV -key data_files/server2.key \ | 
|  | 2730 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2731 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2732 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2733 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2734 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2735 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 2736 | -C "Ciphersuite is TLS-" | 
|  | 2737 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 2738 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 2739 | "$O_SRV -key data_files/server2.key \ | 
|  | 2740 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 2741 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 2742 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 2743 | 0 \ | 
|  | 2744 | -c "bad certificate (usage extensions)" \ | 
|  | 2745 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2746 | -c "Ciphersuite is TLS-" \ | 
|  | 2747 | -c "! Usage does not match the keyUsage extension" | 
|  | 2748 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2749 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 2750 | # server-side checking of client cert | 
|  | 2751 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2752 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2753 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2754 | "$O_CLI -key data_files/server2.key \ | 
|  | 2755 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 2756 | 0 \ | 
|  | 2757 | -S "bad certificate (usage extensions)" \ | 
|  | 2758 | -S "Processing of the Certificate handshake message failed" | 
|  | 2759 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2760 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2761 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2762 | "$O_CLI -key data_files/server2.key \ | 
|  | 2763 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 2764 | 0 \ | 
|  | 2765 | -s "bad certificate (usage extensions)" \ | 
|  | 2766 | -S "Processing of the Certificate handshake message failed" | 
|  | 2767 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2768 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2769 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2770 | "$O_CLI -key data_files/server2.key \ | 
|  | 2771 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 2772 | 1 \ | 
|  | 2773 | -s "bad certificate (usage extensions)" \ | 
|  | 2774 | -s "Processing of the Certificate handshake message failed" | 
|  | 2775 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2776 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2777 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2778 | "$O_CLI -key data_files/server5.key \ | 
|  | 2779 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 2780 | 0 \ | 
|  | 2781 | -S "bad certificate (usage extensions)" \ | 
|  | 2782 | -S "Processing of the Certificate handshake message failed" | 
|  | 2783 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2784 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2785 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 2786 | "$O_CLI -key data_files/server5.key \ | 
|  | 2787 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 2788 | 0 \ | 
|  | 2789 | -s "bad certificate (usage extensions)" \ | 
|  | 2790 | -S "Processing of the Certificate handshake message failed" | 
|  | 2791 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2792 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 2793 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2794 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2795 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 2796 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 2797 | "$P_CLI" \ | 
|  | 2798 | 0 | 
|  | 2799 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2800 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2801 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 2802 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 2803 | "$P_CLI" \ | 
|  | 2804 | 0 | 
|  | 2805 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2806 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2807 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 2808 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 2809 | "$P_CLI" \ | 
|  | 2810 | 0 | 
|  | 2811 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2812 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2813 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2814 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 2815 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2816 | 1 | 
|  | 2817 |  | 
|  | 2818 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 2819 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2820 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2821 | "$O_SRV -key data_files/server5.key \ | 
|  | 2822 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2823 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2824 | 0 \ | 
|  | 2825 | -C "bad certificate (usage extensions)" \ | 
|  | 2826 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2827 | -c "Ciphersuite is TLS-" | 
|  | 2828 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2829 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2830 | "$O_SRV -key data_files/server5.key \ | 
|  | 2831 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2832 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2833 | 0 \ | 
|  | 2834 | -C "bad certificate (usage extensions)" \ | 
|  | 2835 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2836 | -c "Ciphersuite is TLS-" | 
|  | 2837 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2838 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2839 | "$O_SRV -key data_files/server5.key \ | 
|  | 2840 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2841 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2842 | 0 \ | 
|  | 2843 | -C "bad certificate (usage extensions)" \ | 
|  | 2844 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 2845 | -c "Ciphersuite is TLS-" | 
|  | 2846 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2847 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2848 | "$O_SRV -key data_files/server5.key \ | 
|  | 2849 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2850 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2851 | 1 \ | 
|  | 2852 | -c "bad certificate (usage extensions)" \ | 
|  | 2853 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 2854 | -C "Ciphersuite is TLS-" | 
|  | 2855 |  | 
|  | 2856 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 2857 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2858 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2859 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2860 | "$O_CLI -key data_files/server5.key \ | 
|  | 2861 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 2862 | 0 \ | 
|  | 2863 | -S "bad certificate (usage extensions)" \ | 
|  | 2864 | -S "Processing of the Certificate handshake message failed" | 
|  | 2865 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2866 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2867 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2868 | "$O_CLI -key data_files/server5.key \ | 
|  | 2869 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 2870 | 0 \ | 
|  | 2871 | -S "bad certificate (usage extensions)" \ | 
|  | 2872 | -S "Processing of the Certificate handshake message failed" | 
|  | 2873 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2874 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2875 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2876 | "$O_CLI -key data_files/server5.key \ | 
|  | 2877 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 2878 | 0 \ | 
|  | 2879 | -S "bad certificate (usage extensions)" \ | 
|  | 2880 | -S "Processing of the Certificate handshake message failed" | 
|  | 2881 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2882 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2883 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2884 | "$O_CLI -key data_files/server5.key \ | 
|  | 2885 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 2886 | 0 \ | 
|  | 2887 | -s "bad certificate (usage extensions)" \ | 
|  | 2888 | -S "Processing of the Certificate handshake message failed" | 
|  | 2889 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2890 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2891 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 2892 | "$O_CLI -key data_files/server5.key \ | 
|  | 2893 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 2894 | 1 \ | 
|  | 2895 | -s "bad certificate (usage extensions)" \ | 
|  | 2896 | -s "Processing of the Certificate handshake message failed" | 
|  | 2897 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2898 | # Tests for DHM parameters loading | 
|  | 2899 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2900 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2901 | "$P_SRV" \ | 
|  | 2902 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2903 | debug_level=3" \ | 
|  | 2904 | 0 \ | 
|  | 2905 | -c "value of 'DHM: P ' (2048 bits)" \ | 
|  | 2906 | -c "value of 'DHM: G ' (2048 bits)" | 
|  | 2907 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2908 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 2909 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 2910 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2911 | debug_level=3" \ | 
|  | 2912 | 0 \ | 
|  | 2913 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 2914 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 2915 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 2916 | # Tests for DHM client-side size checking | 
|  | 2917 |  | 
|  | 2918 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 2919 | "$P_SRV" \ | 
|  | 2920 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2921 | debug_level=1" \ | 
|  | 2922 | 0 \ | 
|  | 2923 | -C "DHM prime too short:" | 
|  | 2924 |  | 
|  | 2925 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 2926 | "$P_SRV" \ | 
|  | 2927 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2928 | debug_level=1 dhmlen=2048" \ | 
|  | 2929 | 0 \ | 
|  | 2930 | -C "DHM prime too short:" | 
|  | 2931 |  | 
|  | 2932 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 2933 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 2934 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2935 | debug_level=1" \ | 
|  | 2936 | 0 \ | 
|  | 2937 | -C "DHM prime too short:" | 
|  | 2938 |  | 
|  | 2939 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 2940 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 2941 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2942 | debug_level=1" \ | 
|  | 2943 | 1 \ | 
|  | 2944 | -c "DHM prime too short:" | 
|  | 2945 |  | 
|  | 2946 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 2947 | "$P_SRV" \ | 
|  | 2948 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2949 | debug_level=1 dhmlen=2049" \ | 
|  | 2950 | 1 \ | 
|  | 2951 | -c "DHM prime too short:" | 
|  | 2952 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2953 | # Tests for PSK callback | 
|  | 2954 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2955 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2956 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 2957 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 2958 | psk_identity=foo psk=abc123" \ | 
|  | 2959 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2960 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2961 | -S "SSL - Unknown identity received" \ | 
|  | 2962 | -S "SSL - Verification of the message MAC failed" | 
|  | 2963 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2964 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 2965 | "$P_SRV" \ | 
|  | 2966 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 2967 | psk_identity=foo psk=abc123" \ | 
|  | 2968 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2969 | -s "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2970 | -S "SSL - Unknown identity received" \ | 
|  | 2971 | -S "SSL - Verification of the message MAC failed" | 
|  | 2972 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2973 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2974 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 2975 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 2976 | psk_identity=foo psk=abc123" \ | 
|  | 2977 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2978 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2979 | -s "SSL - Unknown identity received" \ | 
|  | 2980 | -S "SSL - Verification of the message MAC failed" | 
|  | 2981 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2982 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2983 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 2984 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 2985 | psk_identity=abc psk=dead" \ | 
|  | 2986 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2987 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2988 | -S "SSL - Unknown identity received" \ | 
|  | 2989 | -S "SSL - Verification of the message MAC failed" | 
|  | 2990 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2991 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2992 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 2993 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 2994 | psk_identity=def psk=beef" \ | 
|  | 2995 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 2996 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 2997 | -S "SSL - Unknown identity received" \ | 
|  | 2998 | -S "SSL - Verification of the message MAC failed" | 
|  | 2999 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3000 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3001 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3002 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3003 | psk_identity=ghi psk=beef" \ | 
|  | 3004 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3005 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3006 | -s "SSL - Unknown identity received" \ | 
|  | 3007 | -S "SSL - Verification of the message MAC failed" | 
|  | 3008 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3009 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3010 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3011 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3012 | psk_identity=abc psk=beef" \ | 
|  | 3013 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3014 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3015 | -S "SSL - Unknown identity received" \ | 
|  | 3016 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3017 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3018 | # Tests for EC J-PAKE | 
|  | 3019 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3020 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3021 | run_test    "ECJPAKE: client not configured" \ | 
|  | 3022 | "$P_SRV debug_level=3" \ | 
|  | 3023 | "$P_CLI debug_level=3" \ | 
|  | 3024 | 0 \ | 
|  | 3025 | -C "add ciphersuite: c0ff" \ | 
|  | 3026 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3027 | -S "found ecjpake kkpp extension" \ | 
|  | 3028 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3029 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3030 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3031 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3032 | -S "None of the common ciphersuites is usable" | 
|  | 3033 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3034 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3035 | run_test    "ECJPAKE: server not configured" \ | 
|  | 3036 | "$P_SRV debug_level=3" \ | 
|  | 3037 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3038 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3039 | 1 \ | 
|  | 3040 | -c "add ciphersuite: c0ff" \ | 
|  | 3041 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3042 | -s "found ecjpake kkpp extension" \ | 
|  | 3043 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3044 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3045 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3046 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3047 | -s "None of the common ciphersuites is usable" | 
|  | 3048 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3049 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3050 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 3051 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3052 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3053 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3054 | 0 \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3055 | -c "add ciphersuite: c0ff" \ | 
|  | 3056 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3057 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3058 | -s "found ecjpake kkpp extension" \ | 
|  | 3059 | -S "skip ecjpake kkpp extension" \ | 
|  | 3060 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3061 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3062 | -c "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3063 | -S "None of the common ciphersuites is usable" \ | 
|  | 3064 | -S "SSL - Verification of the message MAC failed" | 
|  | 3065 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3066 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3067 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3068 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 3069 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3070 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 3071 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3072 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3073 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3074 | -s "SSL - Verification of the message MAC failed" | 
|  | 3075 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3077 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 3078 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3079 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3080 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3081 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3082 | -c "re-using cached ecjpake parameters" \ | 
|  | 3083 | -S "SSL - Verification of the message MAC failed" | 
|  | 3084 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3085 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3086 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 3087 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 3088 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3089 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3090 | 0 \ | 
|  | 3091 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3092 | -S "SSL - Verification of the message MAC failed" | 
|  | 3093 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3094 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3095 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3096 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 3097 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3098 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 3099 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3100 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3101 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3102 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3103 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3104 | # for tests with configs/config-thread.h | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3105 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3106 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 3107 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 3108 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 3109 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3110 | 0 | 
|  | 3111 |  | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3112 | # Tests for ciphersuites per version | 
|  | 3113 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3115 | run_test    "Per-version suites: SSL3" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3116 | "$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] | 3117 | "$P_CLI force_version=ssl3" \ | 
|  | 3118 | 0 \ | 
|  | 3119 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" | 
|  | 3120 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3121 | run_test    "Per-version suites: TLS 1.0" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3122 | "$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] | 3123 | "$P_CLI force_version=tls1 arc4=1" \ | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3124 | 0 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3125 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3126 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3127 | run_test    "Per-version suites: TLS 1.1" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3128 | "$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] | 3129 | "$P_CLI force_version=tls1_1" \ | 
|  | 3130 | 0 \ | 
|  | 3131 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" | 
|  | 3132 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3133 | run_test    "Per-version suites: TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3134 | "$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] | 3135 | "$P_CLI force_version=tls1_2" \ | 
|  | 3136 | 0 \ | 
|  | 3137 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" | 
|  | 3138 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3139 | # Test for ClientHello without extensions | 
|  | 3140 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3141 | requires_gnutls | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3142 | run_test    "ClientHello without extensions, SHA-1 allowed" \ | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3143 | "$P_SRV debug_level=3" \ | 
|  | 3144 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3145 | 0 \ | 
|  | 3146 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3147 |  | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3148 | requires_gnutls | 
|  | 3149 | run_test    "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ | 
|  | 3150 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ | 
|  | 3151 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3152 | 0 \ | 
|  | 3153 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3154 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3155 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3156 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3157 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3158 | "$P_SRV" \ | 
|  | 3159 | "$P_CLI request_size=100" \ | 
|  | 3160 | 0 \ | 
|  | 3161 | -s "Read from client: 100 bytes read$" | 
|  | 3162 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3163 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3164 | "$P_SRV" \ | 
|  | 3165 | "$P_CLI request_size=500" \ | 
|  | 3166 | 0 \ | 
|  | 3167 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3168 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3169 | # Tests for small packets | 
|  | 3170 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3171 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3172 | run_test    "Small packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3173 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3174 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3175 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3176 | 0 \ | 
|  | 3177 | -s "Read from client: 1 bytes read" | 
|  | 3178 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3179 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3180 | run_test    "Small packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3181 | "$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] | 3182 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3183 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3184 | 0 \ | 
|  | 3185 | -s "Read from client: 1 bytes read" | 
|  | 3186 |  | 
|  | 3187 | run_test    "Small packet TLS 1.0 BlockCipher" \ | 
|  | 3188 | "$P_SRV" \ | 
|  | 3189 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 3190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3191 | 0 \ | 
|  | 3192 | -s "Read from client: 1 bytes read" | 
|  | 3193 |  | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3194 | run_test    "Small packet TLS 1.0 BlockCipher without EtM" \ | 
|  | 3195 | "$P_SRV" \ | 
|  | 3196 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ | 
|  | 3197 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3198 | 0 \ | 
|  | 3199 | -s "Read from client: 1 bytes read" | 
|  | 3200 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3201 | run_test    "Small packet TLS 1.0 BlockCipher truncated MAC" \ | 
|  | 3202 | "$P_SRV" \ | 
|  | 3203 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 3204 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3205 | trunc_hmac=1" \ | 
|  | 3206 | 0 \ | 
|  | 3207 | -s "Read from client: 1 bytes read" | 
|  | 3208 |  | 
|  | 3209 | run_test    "Small packet TLS 1.0 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3210 | "$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] | 3211 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 3212 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3213 | trunc_hmac=1" \ | 
|  | 3214 | 0 \ | 
|  | 3215 | -s "Read from client: 1 bytes read" | 
|  | 3216 |  | 
|  | 3217 | run_test    "Small packet TLS 1.1 BlockCipher" \ | 
|  | 3218 | "$P_SRV" \ | 
|  | 3219 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3220 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3221 | 0 \ | 
|  | 3222 | -s "Read from client: 1 bytes read" | 
|  | 3223 |  | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3224 | run_test    "Small packet TLS 1.1 BlockCipher without EtM" \ | 
|  | 3225 | "$P_SRV" \ | 
|  | 3226 | "$P_CLI request_size=1 force_version=tls1_1 etm=0 \ | 
|  | 3227 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3228 | 0 \ | 
|  | 3229 | -s "Read from client: 1 bytes read" | 
|  | 3230 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3231 | run_test    "Small packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3232 | "$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] | 3233 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3234 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3235 | 0 \ | 
|  | 3236 | -s "Read from client: 1 bytes read" | 
|  | 3237 |  | 
|  | 3238 | run_test    "Small packet TLS 1.1 BlockCipher truncated MAC" \ | 
|  | 3239 | "$P_SRV" \ | 
|  | 3240 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3241 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3242 | trunc_hmac=1" \ | 
|  | 3243 | 0 \ | 
|  | 3244 | -s "Read from client: 1 bytes read" | 
|  | 3245 |  | 
|  | 3246 | run_test    "Small packet TLS 1.1 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3247 | "$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] | 3248 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3249 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3250 | trunc_hmac=1" \ | 
|  | 3251 | 0 \ | 
|  | 3252 | -s "Read from client: 1 bytes read" | 
|  | 3253 |  | 
|  | 3254 | run_test    "Small packet TLS 1.2 BlockCipher" \ | 
|  | 3255 | "$P_SRV" \ | 
|  | 3256 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3257 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3258 | 0 \ | 
|  | 3259 | -s "Read from client: 1 bytes read" | 
|  | 3260 |  | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3261 | run_test    "Small packet TLS 1.2 BlockCipher without EtM" \ | 
|  | 3262 | "$P_SRV" \ | 
|  | 3263 | "$P_CLI request_size=1 force_version=tls1_2 etm=0 \ | 
|  | 3264 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3265 | 0 \ | 
|  | 3266 | -s "Read from client: 1 bytes read" | 
|  | 3267 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3268 | run_test    "Small packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 3269 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3270 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3271 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3272 | 0 \ | 
|  | 3273 | -s "Read from client: 1 bytes read" | 
|  | 3274 |  | 
|  | 3275 | run_test    "Small packet TLS 1.2 BlockCipher truncated MAC" \ | 
|  | 3276 | "$P_SRV" \ | 
|  | 3277 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3279 | trunc_hmac=1" \ | 
|  | 3280 | 0 \ | 
|  | 3281 | -s "Read from client: 1 bytes read" | 
|  | 3282 |  | 
|  | 3283 | run_test    "Small packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3284 | "$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] | 3285 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3286 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3287 | 0 \ | 
|  | 3288 | -s "Read from client: 1 bytes read" | 
|  | 3289 |  | 
|  | 3290 | run_test    "Small packet TLS 1.2 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3291 | "$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] | 3292 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3293 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3294 | trunc_hmac=1" \ | 
|  | 3295 | 0 \ | 
|  | 3296 | -s "Read from client: 1 bytes read" | 
|  | 3297 |  | 
|  | 3298 | run_test    "Small packet TLS 1.2 AEAD" \ | 
|  | 3299 | "$P_SRV" \ | 
|  | 3300 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 3302 | 0 \ | 
|  | 3303 | -s "Read from client: 1 bytes read" | 
|  | 3304 |  | 
|  | 3305 | run_test    "Small packet TLS 1.2 AEAD shorter tag" \ | 
|  | 3306 | "$P_SRV" \ | 
|  | 3307 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 3308 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 3309 | 0 \ | 
|  | 3310 | -s "Read from client: 1 bytes read" | 
|  | 3311 |  | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 3312 | # A test for extensions in SSLv3 | 
|  | 3313 |  | 
|  | 3314 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 3315 | run_test    "SSLv3 with extensions, server side" \ | 
|  | 3316 | "$P_SRV min_version=ssl3 debug_level=3" \ | 
|  | 3317 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ | 
|  | 3318 | 0 \ | 
|  | 3319 | -S "dumping 'client hello extensions'" \ | 
|  | 3320 | -S "server hello, total extension length:" | 
|  | 3321 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3322 | # Test for large packets | 
|  | 3323 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3324 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3325 | run_test    "Large packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3326 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3327 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3329 | 0 \ | 
|  | 3330 | -s "Read from client: 16384 bytes read" | 
|  | 3331 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3332 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3333 | run_test    "Large packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3334 | "$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] | 3335 | "$P_CLI request_size=16384 force_version=ssl3 \ | 
|  | 3336 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3337 | 0 \ | 
|  | 3338 | -s "Read from client: 16384 bytes read" | 
|  | 3339 |  | 
|  | 3340 | run_test    "Large packet TLS 1.0 BlockCipher" \ | 
|  | 3341 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3342 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3343 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3344 | 0 \ | 
|  | 3345 | -s "Read from client: 16384 bytes read" | 
|  | 3346 |  | 
|  | 3347 | run_test    "Large packet TLS 1.0 BlockCipher truncated MAC" \ | 
|  | 3348 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3349 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3350 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3351 | trunc_hmac=1" \ | 
|  | 3352 | 0 \ | 
|  | 3353 | -s "Read from client: 16384 bytes read" | 
|  | 3354 |  | 
|  | 3355 | run_test    "Large packet TLS 1.0 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3356 | "$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] | 3357 | "$P_CLI request_size=16384 force_version=tls1 \ | 
|  | 3358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3359 | trunc_hmac=1" \ | 
|  | 3360 | 0 \ | 
|  | 3361 | -s "Read from client: 16384 bytes read" | 
|  | 3362 |  | 
|  | 3363 | run_test    "Large packet TLS 1.1 BlockCipher" \ | 
|  | 3364 | "$P_SRV" \ | 
|  | 3365 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3366 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3367 | 0 \ | 
|  | 3368 | -s "Read from client: 16384 bytes read" | 
|  | 3369 |  | 
|  | 3370 | run_test    "Large packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3371 | "$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] | 3372 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3373 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3374 | 0 \ | 
|  | 3375 | -s "Read from client: 16384 bytes read" | 
|  | 3376 |  | 
|  | 3377 | run_test    "Large packet TLS 1.1 BlockCipher truncated MAC" \ | 
|  | 3378 | "$P_SRV" \ | 
|  | 3379 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3380 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3381 | trunc_hmac=1" \ | 
|  | 3382 | 0 \ | 
|  | 3383 | -s "Read from client: 16384 bytes read" | 
|  | 3384 |  | 
|  | 3385 | run_test    "Large packet TLS 1.1 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3386 | "$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] | 3387 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 3388 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3389 | trunc_hmac=1" \ | 
|  | 3390 | 0 \ | 
|  | 3391 | -s "Read from client: 16384 bytes read" | 
|  | 3392 |  | 
|  | 3393 | run_test    "Large packet TLS 1.2 BlockCipher" \ | 
|  | 3394 | "$P_SRV" \ | 
|  | 3395 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3396 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3397 | 0 \ | 
|  | 3398 | -s "Read from client: 16384 bytes read" | 
|  | 3399 |  | 
|  | 3400 | run_test    "Large packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 3401 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3402 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3403 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 3404 | 0 \ | 
|  | 3405 | -s "Read from client: 16384 bytes read" | 
|  | 3406 |  | 
|  | 3407 | run_test    "Large packet TLS 1.2 BlockCipher truncated MAC" \ | 
|  | 3408 | "$P_SRV" \ | 
|  | 3409 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3410 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 3411 | trunc_hmac=1" \ | 
|  | 3412 | 0 \ | 
|  | 3413 | -s "Read from client: 16384 bytes read" | 
|  | 3414 |  | 
|  | 3415 | run_test    "Large packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3416 | "$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] | 3417 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3418 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3419 | 0 \ | 
|  | 3420 | -s "Read from client: 16384 bytes read" | 
|  | 3421 |  | 
|  | 3422 | run_test    "Large packet TLS 1.2 StreamCipher truncated MAC" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3423 | "$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] | 3424 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3426 | trunc_hmac=1" \ | 
|  | 3427 | 0 \ | 
|  | 3428 | -s "Read from client: 16384 bytes read" | 
|  | 3429 |  | 
|  | 3430 | run_test    "Large packet TLS 1.2 AEAD" \ | 
|  | 3431 | "$P_SRV" \ | 
|  | 3432 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3433 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 3434 | 0 \ | 
|  | 3435 | -s "Read from client: 16384 bytes read" | 
|  | 3436 |  | 
|  | 3437 | run_test    "Large packet TLS 1.2 AEAD shorter tag" \ | 
|  | 3438 | "$P_SRV" \ | 
|  | 3439 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 3440 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 3441 | 0 \ | 
|  | 3442 | -s "Read from client: 16384 bytes read" | 
|  | 3443 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3444 | # Tests for restartable ECC | 
|  | 3445 |  | 
|  | 3446 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3447 | run_test    "EC restart: TLS, default" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3448 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3449 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3450 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3451 | debug_level=1" \ | 
|  | 3452 | 0 \ | 
| Manuel Pégourié-Gonnard | 1f1f2a1 | 2017-05-18 11:27:06 +0200 | [diff] [blame] | 3453 | -C "mbedtls_pk_verify.*4b80" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3454 | -C "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3455 | -C "mbedtls_pk_sign.*4b80" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3456 |  | 
|  | 3457 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3458 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3459 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3460 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3461 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3462 | debug_level=1 ec_max_ops=0" \ | 
|  | 3463 | 0 \ | 
| Manuel Pégourié-Gonnard | 1f1f2a1 | 2017-05-18 11:27:06 +0200 | [diff] [blame] | 3464 | -C "mbedtls_pk_verify.*4b80" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3465 | -C "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3466 | -C "mbedtls_pk_sign.*4b80" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3467 |  | 
|  | 3468 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3469 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3470 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3471 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3472 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3473 | debug_level=1 ec_max_ops=65535" \ | 
|  | 3474 | 0 \ | 
| Manuel Pégourié-Gonnard | 1f1f2a1 | 2017-05-18 11:27:06 +0200 | [diff] [blame] | 3475 | -C "mbedtls_pk_verify.*4b80" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3476 | -C "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3477 | -C "mbedtls_pk_sign.*4b80" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3478 |  | 
|  | 3479 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3480 | run_test    "EC restart: TLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3481 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3482 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3483 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3484 | debug_level=1 ec_max_ops=1000" \ | 
|  | 3485 | 0 \ | 
| Manuel Pégourié-Gonnard | 1f1f2a1 | 2017-05-18 11:27:06 +0200 | [diff] [blame] | 3486 | -c "mbedtls_pk_verify.*4b80" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3487 | -c "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3488 | -c "mbedtls_pk_sign.*4b80" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3489 |  | 
|  | 3490 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3491 | run_test    "EC restart: DTLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3492 | "$P_SRV auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3493 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3494 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3495 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 3496 | 0 \ | 
| Manuel Pégourié-Gonnard | 1f1f2a1 | 2017-05-18 11:27:06 +0200 | [diff] [blame] | 3497 | -c "mbedtls_pk_verify.*4b80" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 3498 | -c "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3499 | -c "mbedtls_pk_sign.*4b80" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 3500 |  | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 3501 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3502 | run_test    "EC restart: TLS, max_ops=1000 no client auth" \ | 
|  | 3503 | "$P_SRV" \ | 
|  | 3504 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 3505 | debug_level=1 ec_max_ops=1000" \ | 
|  | 3506 | 0 \ | 
|  | 3507 | -c "mbedtls_pk_verify.*4b80" \ | 
|  | 3508 | -c "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3509 | -C "mbedtls_pk_sign.*4b80" | 
|  | 3510 |  | 
|  | 3511 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 3512 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ | 
|  | 3513 | "$P_SRV psk=abc123" \ | 
|  | 3514 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 3515 | psk=abc123 debug_level=1 ec_max_ops=1000" \ | 
|  | 3516 | 0 \ | 
|  | 3517 | -C "mbedtls_pk_verify.*4b80" \ | 
|  | 3518 | -C "mbedtls_ecdh_make_public.*4b80" \ | 
|  | 3519 | -C "mbedtls_pk_sign.*4b80" | 
|  | 3520 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3521 | # Tests for DTLS HelloVerifyRequest | 
|  | 3522 |  | 
|  | 3523 | run_test    "DTLS cookie: enabled" \ | 
|  | 3524 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 3525 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3526 | 0 \ | 
|  | 3527 | -s "cookie verification failed" \ | 
|  | 3528 | -s "cookie verification passed" \ | 
|  | 3529 | -S "cookie verification skipped" \ | 
|  | 3530 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3531 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3532 | -S "SSL - The requested feature is not available" | 
|  | 3533 |  | 
|  | 3534 | run_test    "DTLS cookie: disabled" \ | 
|  | 3535 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 3536 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3537 | 0 \ | 
|  | 3538 | -S "cookie verification failed" \ | 
|  | 3539 | -S "cookie verification passed" \ | 
|  | 3540 | -s "cookie verification skipped" \ | 
|  | 3541 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3542 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3543 | -S "SSL - The requested feature is not available" | 
|  | 3544 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3545 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 3546 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 3547 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 3548 | 1 \ | 
|  | 3549 | -s "cookie verification failed" \ | 
|  | 3550 | -S "cookie verification passed" \ | 
|  | 3551 | -S "cookie verification skipped" \ | 
|  | 3552 | -C "received hello verify request" \ | 
|  | 3553 | -S "hello verification requested" \ | 
|  | 3554 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3555 |  | 
|  | 3556 | requires_ipv6 | 
|  | 3557 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 3558 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 3559 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 3560 | 0 \ | 
|  | 3561 | -s "cookie verification failed" \ | 
|  | 3562 | -s "cookie verification passed" \ | 
|  | 3563 | -S "cookie verification skipped" \ | 
|  | 3564 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3565 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3566 | -S "SSL - The requested feature is not available" | 
|  | 3567 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 3568 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 3569 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 3570 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 3571 | 0 \ | 
|  | 3572 | -s "cookie verification failed" \ | 
|  | 3573 | -s "cookie verification passed" \ | 
|  | 3574 | -S "cookie verification skipped" \ | 
|  | 3575 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 3576 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 3577 | -S "SSL - The requested feature is not available" | 
|  | 3578 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3579 | # Tests for client reconnecting from the same port with DTLS | 
|  | 3580 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3581 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3582 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3583 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 3584 | "$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] | 3585 | 0 \ | 
|  | 3586 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3587 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3588 | -S "Client initiated reconnection from same port" | 
|  | 3589 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3590 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3591 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3592 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 3593 | "$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] | 3594 | 0 \ | 
|  | 3595 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3596 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3597 | -s "Client initiated reconnection from same port" | 
|  | 3598 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 3599 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 3600 | 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] | 3601 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 3602 | "$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] | 3603 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3604 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 3605 | -s "Client initiated reconnection from same port" | 
|  | 3606 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 3607 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 3608 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 3609 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 3610 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 3611 | 0 \ | 
|  | 3612 | -S "The operation timed out" \ | 
|  | 3613 | -s "Client initiated reconnection from same port" | 
|  | 3614 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3615 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 3616 | "$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] | 3617 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 3618 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 3619 | -s "The operation timed out" \ | 
|  | 3620 | -S "Client initiated reconnection from same port" | 
|  | 3621 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3622 | # Tests for various cases of client authentication with DTLS | 
|  | 3623 | # (focused on handshake flows and message parsing) | 
|  | 3624 |  | 
|  | 3625 | run_test    "DTLS client auth: required" \ | 
|  | 3626 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 3627 | "$P_CLI dtls=1" \ | 
|  | 3628 | 0 \ | 
|  | 3629 | -s "Verifying peer X.509 certificate... ok" | 
|  | 3630 |  | 
|  | 3631 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 3632 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 3633 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 3634 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3635 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3636 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3637 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3638 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 3639 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 3640 | 0 \ | 
|  | 3641 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3642 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 3643 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 3644 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 3645 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 3646 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 3647 | 1 \ | 
|  | 3648 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 3649 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 3650 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 3651 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 3652 |  | 
|  | 3653 | requires_gnutls | 
|  | 3654 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 3655 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 3656 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3657 | 0 \ | 
|  | 3658 | -C "found fragmented DTLS handshake message" \ | 
|  | 3659 | -C "error" | 
|  | 3660 |  | 
|  | 3661 | requires_gnutls | 
|  | 3662 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 3663 | "$G_SRV -u --mtu 512" \ | 
|  | 3664 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3665 | 0 \ | 
|  | 3666 | -c "found fragmented DTLS handshake message" \ | 
|  | 3667 | -C "error" | 
|  | 3668 |  | 
|  | 3669 | requires_gnutls | 
|  | 3670 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 3671 | "$G_SRV -u --mtu 128" \ | 
|  | 3672 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3673 | 0 \ | 
|  | 3674 | -c "found fragmented DTLS handshake message" \ | 
|  | 3675 | -C "error" | 
|  | 3676 |  | 
|  | 3677 | requires_gnutls | 
|  | 3678 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 3679 | "$G_SRV -u --mtu 128" \ | 
|  | 3680 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 3681 | 0 \ | 
|  | 3682 | -c "found fragmented DTLS handshake message" \ | 
|  | 3683 | -C "error" | 
|  | 3684 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3685 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3686 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 3687 | "$G_SRV -u --mtu 256" \ | 
|  | 3688 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 3689 | 0 \ | 
|  | 3690 | -c "found fragmented DTLS handshake message" \ | 
|  | 3691 | -c "client hello, adding renegotiation extension" \ | 
|  | 3692 | -c "found renegotiation extension" \ | 
|  | 3693 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3694 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3695 | -C "error" \ | 
|  | 3696 | -s "Extra-header:" | 
|  | 3697 |  | 
|  | 3698 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3699 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 3700 | "$G_SRV -u --mtu 256" \ | 
|  | 3701 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 3702 | 0 \ | 
|  | 3703 | -c "found fragmented DTLS handshake message" \ | 
|  | 3704 | -c "client hello, adding renegotiation extension" \ | 
|  | 3705 | -c "found renegotiation extension" \ | 
|  | 3706 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3707 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 3708 | -C "error" \ | 
|  | 3709 | -s "Extra-header:" | 
|  | 3710 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3711 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 3712 | "$O_SRV -dtls1 -mtu 2048" \ | 
|  | 3713 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3714 | 0 \ | 
|  | 3715 | -C "found fragmented DTLS handshake message" \ | 
|  | 3716 | -C "error" | 
|  | 3717 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3718 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 3719 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 3720 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3721 | 0 \ | 
|  | 3722 | -c "found fragmented DTLS handshake message" \ | 
|  | 3723 | -C "error" | 
|  | 3724 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3725 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 3726 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 3727 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 3728 | 0 \ | 
|  | 3729 | -c "found fragmented DTLS handshake message" \ | 
|  | 3730 | -C "error" | 
|  | 3731 |  | 
|  | 3732 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 3733 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 3734 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 3735 | 0 \ | 
|  | 3736 | -c "found fragmented DTLS handshake message" \ | 
|  | 3737 | -C "error" | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3738 |  | 
| Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 3739 | # Tests for specific things with "unreliable" UDP connection | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 3740 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3741 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3742 | run_test    "DTLS proxy: reference" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 3743 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3744 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 3745 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3746 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3747 | -C "replayed record" \ | 
|  | 3748 | -S "replayed record" \ | 
|  | 3749 | -C "record from another epoch" \ | 
|  | 3750 | -S "record from another epoch" \ | 
|  | 3751 | -C "discarding invalid record" \ | 
|  | 3752 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3753 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3754 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3755 | -c "HTTP/1.0 200 OK" | 
|  | 3756 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3757 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3758 | run_test    "DTLS proxy: duplicate every packet" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3759 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3760 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 3761 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 3762 | 0 \ | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 3763 | -c "replayed record" \ | 
|  | 3764 | -s "replayed record" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3765 | -c "discarding invalid record" \ | 
|  | 3766 | -s "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3767 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 3768 | -s "Extra-header:" \ | 
|  | 3769 | -c "HTTP/1.0 200 OK" | 
|  | 3770 |  | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3771 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 3772 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3773 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ | 
|  | 3774 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3775 | 0 \ | 
|  | 3776 | -c "replayed record" \ | 
|  | 3777 | -S "replayed record" \ | 
|  | 3778 | -c "discarding invalid record" \ | 
|  | 3779 | -s "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 3780 | -c "resend" \ | 
|  | 3781 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 3782 | -s "Extra-header:" \ | 
|  | 3783 | -c "HTTP/1.0 200 OK" | 
|  | 3784 |  | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3785 | 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] | 3786 | -p "$P_PXY bad_ad=1" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3787 | "$P_SRV dtls=1 debug_level=1" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3788 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3789 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3790 | -c "discarding invalid record (mac)" \ | 
|  | 3791 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3792 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3793 | -c "HTTP/1.0 200 OK" \ | 
|  | 3794 | -S "too many records with bad MAC" \ | 
|  | 3795 | -S "Verification of the message MAC failed" | 
|  | 3796 |  | 
|  | 3797 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 3798 | -p "$P_PXY bad_ad=1" \ | 
|  | 3799 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ | 
|  | 3800 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
|  | 3801 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3802 | -C "discarding invalid record (mac)" \ | 
|  | 3803 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3804 | -S "Extra-header:" \ | 
|  | 3805 | -C "HTTP/1.0 200 OK" \ | 
|  | 3806 | -s "too many records with bad MAC" \ | 
|  | 3807 | -s "Verification of the message MAC failed" | 
|  | 3808 |  | 
|  | 3809 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 3810 | -p "$P_PXY bad_ad=1" \ | 
|  | 3811 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ | 
|  | 3812 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ | 
|  | 3813 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3814 | -c "discarding invalid record (mac)" \ | 
|  | 3815 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3816 | -s "Extra-header:" \ | 
|  | 3817 | -c "HTTP/1.0 200 OK" \ | 
|  | 3818 | -S "too many records with bad MAC" \ | 
|  | 3819 | -S "Verification of the message MAC failed" | 
|  | 3820 |  | 
|  | 3821 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 3822 | -p "$P_PXY bad_ad=1" \ | 
|  | 3823 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 3824 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ | 
|  | 3825 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 3826 | -c "discarding invalid record (mac)" \ | 
|  | 3827 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 3828 | -s "Extra-header:" \ | 
|  | 3829 | -c "HTTP/1.0 200 OK" \ | 
|  | 3830 | -s "too many records with bad MAC" \ | 
|  | 3831 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3832 |  | 
|  | 3833 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3834 | -p "$P_PXY delay_ccs=1" \ | 
|  | 3835 | "$P_SRV dtls=1 debug_level=1" \ | 
|  | 3836 | "$P_CLI dtls=1 debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3837 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3838 | -c "record from another epoch" \ | 
|  | 3839 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3840 | -c "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 3841 | -s "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3842 | -s "Extra-header:" \ | 
|  | 3843 | -c "HTTP/1.0 200 OK" | 
|  | 3844 |  | 
| Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 3845 | # 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] | 3846 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3847 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3848 | 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] | 3849 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3850 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 3851 | psk=abc123" \ | 
|  | 3852 | "$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] | 3853 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3854 | 0 \ | 
|  | 3855 | -s "Extra-header:" \ | 
|  | 3856 | -c "HTTP/1.0 200 OK" | 
|  | 3857 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3858 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3859 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 3860 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3861 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 3862 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3863 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3864 | 0 \ | 
|  | 3865 | -s "Extra-header:" \ | 
|  | 3866 | -c "HTTP/1.0 200 OK" | 
|  | 3867 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3868 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3869 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 3870 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3871 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 3872 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3873 | 0 \ | 
|  | 3874 | -s "Extra-header:" \ | 
|  | 3875 | -c "HTTP/1.0 200 OK" | 
|  | 3876 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3877 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3878 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 3879 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3880 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ | 
|  | 3881 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3882 | 0 \ | 
|  | 3883 | -s "Extra-header:" \ | 
|  | 3884 | -c "HTTP/1.0 200 OK" | 
|  | 3885 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3886 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3887 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 3888 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3889 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ | 
|  | 3890 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3891 | 0 \ | 
|  | 3892 | -s "Extra-header:" \ | 
|  | 3893 | -c "HTTP/1.0 200 OK" | 
|  | 3894 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3895 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 3896 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 3897 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3898 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ | 
|  | 3899 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 3900 | 0 \ | 
|  | 3901 | -s "Extra-header:" \ | 
|  | 3902 | -c "HTTP/1.0 200 OK" | 
|  | 3903 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3904 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3905 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 3906 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3907 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ | 
|  | 3908 | auth_mode=required" \ | 
|  | 3909 | "$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] | 3910 | 0 \ | 
|  | 3911 | -s "Extra-header:" \ | 
|  | 3912 | -c "HTTP/1.0 200 OK" | 
|  | 3913 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3914 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 3915 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 3916 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 3917 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 3918 | psk=abc123 debug_level=3" \ | 
|  | 3919 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 3920 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 3921 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3922 | 0 \ | 
|  | 3923 | -s "a session has been resumed" \ | 
|  | 3924 | -c "a session has been resumed" \ | 
|  | 3925 | -s "Extra-header:" \ | 
|  | 3926 | -c "HTTP/1.0 200 OK" | 
|  | 3927 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3928 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 3929 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 3930 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 3931 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 3932 | psk=abc123 debug_level=3 nbio=2" \ | 
|  | 3933 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 3934 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 3935 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 3936 | 0 \ | 
|  | 3937 | -s "a session has been resumed" \ | 
|  | 3938 | -c "a session has been resumed" \ | 
|  | 3939 | -s "Extra-header:" \ | 
|  | 3940 | -c "HTTP/1.0 200 OK" | 
|  | 3941 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3942 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3943 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3944 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3945 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 3946 | psk=abc123 renegotiation=1 debug_level=2" \ | 
|  | 3947 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 3948 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 3949 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3950 | 0 \ | 
|  | 3951 | -c "=> renegotiate" \ | 
|  | 3952 | -s "=> renegotiate" \ | 
|  | 3953 | -s "Extra-header:" \ | 
|  | 3954 | -c "HTTP/1.0 200 OK" | 
|  | 3955 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3956 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3957 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 3958 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 3959 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
|  | 3960 | psk=abc123 renegotiation=1 debug_level=2" \ | 
|  | 3961 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 3962 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 3963 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3964 | 0 \ | 
|  | 3965 | -c "=> renegotiate" \ | 
|  | 3966 | -s "=> renegotiate" \ | 
|  | 3967 | -s "Extra-header:" \ | 
|  | 3968 | -c "HTTP/1.0 200 OK" | 
|  | 3969 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3970 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3971 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 3972 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3973 | "$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] | 3974 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3975 | debug_level=2" \ | 
|  | 3976 | "$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] | 3977 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3978 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3979 | 0 \ | 
|  | 3980 | -c "=> renegotiate" \ | 
|  | 3981 | -s "=> renegotiate" \ | 
|  | 3982 | -s "Extra-header:" \ | 
|  | 3983 | -c "HTTP/1.0 200 OK" | 
|  | 3984 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3985 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3986 | 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] | 3987 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3988 | "$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] | 3989 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3990 | debug_level=2 nbio=2" \ | 
|  | 3991 | "$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] | 3992 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 3993 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 3994 | 0 \ | 
|  | 3995 | -c "=> renegotiate" \ | 
|  | 3996 | -s "=> renegotiate" \ | 
|  | 3997 | -s "Extra-header:" \ | 
|  | 3998 | -c "HTTP/1.0 200 OK" | 
|  | 3999 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4000 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4001 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4002 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4003 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4004 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4005 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4006 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 4007 | -c "HTTP/1.0 200 OK" | 
|  | 4008 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4009 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4010 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4011 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 4012 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4013 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4014 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4015 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4016 | -c "HTTP/1.0 200 OK" | 
|  | 4017 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4018 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4019 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4020 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 4021 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 4022 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 4023 | "$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] | 4024 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4025 | -c "HTTP/1.0 200 OK" | 
|  | 4026 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4027 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4028 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4029 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4030 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 4031 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4032 | "$G_SRV -u --mtu 2048 -a" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4033 | "$P_CLI dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4034 | 0 \ | 
|  | 4035 | -s "Extra-header:" \ | 
|  | 4036 | -c "Extra-header:" | 
|  | 4037 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4038 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4039 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4040 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4041 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 4042 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4043 | "$G_SRV -u --mtu 512" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4044 | "$P_CLI dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 4045 | 0 \ | 
|  | 4046 | -s "Extra-header:" \ | 
|  | 4047 | -c "Extra-header:" | 
|  | 4048 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4049 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4050 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 4051 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4052 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 4053 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 4054 | "$G_SRV -u --mtu 512" \ | 
| Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 4055 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4056 | 0 \ | 
|  | 4057 | -s "Extra-header:" \ | 
|  | 4058 | -c "Extra-header:" | 
|  | 4059 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4060 | # Final report | 
|  | 4061 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4062 | echo "------------------------------------------------------------------------" | 
|  | 4063 |  | 
|  | 4064 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 4065 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4066 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 4067 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4068 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 4069 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 4070 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4071 |  | 
|  | 4072 | exit $FAILS |