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