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