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