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