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