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