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