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