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