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