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 | |
Azim Khan | 341e378 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 180 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 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 |
Gilles Peskine | 2cc7ad4 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 257 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 684a517 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 258 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 259 | sleep "$START_DELAY" |
Gilles Peskine | 684a517 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 260 | } |
| 261 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 262 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 263 | # wait for client to terminate and set CLI_EXIT |
| 264 | # must be called right after starting the client |
| 265 | wait_client_done() { |
| 266 | CLI_PID=$! |
| 267 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 268 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 269 | CLI_DELAY_FACTOR=1 |
| 270 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 271 | ( 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] | 272 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 273 | |
| 274 | wait $CLI_PID |
| 275 | CLI_EXIT=$? |
| 276 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 277 | kill $DOG_PID >/dev/null 2>&1 |
| 278 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 279 | |
| 280 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
| 281 | } |
| 282 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 283 | # check if the given command uses dtls and sets global variable DTLS |
| 284 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 285 | 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] | 286 | DTLS=1 |
| 287 | else |
| 288 | DTLS=0 |
| 289 | fi |
| 290 | } |
| 291 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 292 | # 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] | 293 | # Options: -s pattern pattern that must be present in server output |
| 294 | # -c pattern pattern that must be present in client output |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 295 | # -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] | 296 | # -S pattern pattern that must be absent in server output |
| 297 | # -C pattern pattern that must be absent in client output |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 298 | # -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] | 299 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 300 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 301 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 302 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 303 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 304 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 305 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 306 | return |
| 307 | fi |
| 308 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 309 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 310 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 311 | # should we skip? |
| 312 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 313 | SKIP_NEXT="NO" |
| 314 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 315 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 316 | return |
| 317 | fi |
| 318 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 319 | # does this test use a proxy? |
| 320 | if [ "X$1" = "X-p" ]; then |
| 321 | PXY_CMD="$2" |
| 322 | shift 2 |
| 323 | else |
| 324 | PXY_CMD="" |
| 325 | fi |
| 326 | |
| 327 | # get commands and client output |
| 328 | SRV_CMD="$1" |
| 329 | CLI_CMD="$2" |
| 330 | CLI_EXPECT="$3" |
| 331 | shift 3 |
| 332 | |
| 333 | # fix client port |
| 334 | if [ -n "$PXY_CMD" ]; then |
| 335 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 336 | else |
| 337 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 338 | fi |
| 339 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 340 | # update DTLS variable |
| 341 | detect_dtls "$SRV_CMD" |
| 342 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 343 | # prepend valgrind to our commands if active |
| 344 | if [ "$MEMCHECK" -gt 0 ]; then |
| 345 | if is_polar "$SRV_CMD"; then |
| 346 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 347 | fi |
| 348 | if is_polar "$CLI_CMD"; then |
| 349 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 350 | fi |
| 351 | fi |
| 352 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 353 | TIMES_LEFT=2 |
| 354 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 355 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 356 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 357 | # run the commands |
| 358 | if [ -n "$PXY_CMD" ]; then |
| 359 | echo "$PXY_CMD" > $PXY_OUT |
| 360 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 361 | PXY_PID=$! |
| 362 | # assume proxy starts faster than server |
| 363 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 364 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 365 | check_osrv_dtls |
| 366 | echo "$SRV_CMD" > $SRV_OUT |
| 367 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 368 | SRV_PID=$! |
Gilles Peskine | 684a517 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 369 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 370 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 371 | echo "$CLI_CMD" > $CLI_OUT |
| 372 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 373 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 374 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 375 | # terminate the server (and the proxy) |
| 376 | kill $SRV_PID |
| 377 | wait $SRV_PID |
| 378 | if [ -n "$PXY_CMD" ]; then |
| 379 | kill $PXY_PID >/dev/null 2>&1 |
| 380 | wait $PXY_PID |
| 381 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 382 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 383 | # retry only on timeouts |
| 384 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 385 | printf "RETRY " |
| 386 | else |
| 387 | TIMES_LEFT=0 |
| 388 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 389 | done |
| 390 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 391 | # 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] | 392 | # (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] | 393 | # expected client exit to incorrectly succeed in case of catastrophic |
| 394 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 395 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 396 | 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] | 397 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 398 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 399 | return |
| 400 | fi |
| 401 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 402 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 403 | 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] | 404 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 405 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 406 | return |
| 407 | fi |
| 408 | fi |
| 409 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 410 | # check server exit code |
| 411 | if [ $? != 0 ]; then |
| 412 | fail "server fail" |
| 413 | return |
| 414 | fi |
| 415 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 416 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 417 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 418 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 419 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 420 | 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] | 421 | return |
| 422 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 423 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 424 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 425 | # lines beginning with == are added by valgrind, ignore them |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 426 | while [ $# -gt 0 ] |
| 427 | do |
| 428 | case $1 in |
| 429 | "-s") |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 430 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
| 431 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 432 | return |
| 433 | fi |
| 434 | ;; |
| 435 | |
| 436 | "-c") |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 437 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
| 438 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 439 | return |
| 440 | fi |
| 441 | ;; |
| 442 | |
| 443 | "-S") |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 444 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
| 445 | 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] | 446 | return |
| 447 | fi |
| 448 | ;; |
| 449 | |
| 450 | "-C") |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 451 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
| 452 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 453 | return |
| 454 | fi |
| 455 | ;; |
| 456 | |
| 457 | # The filtering in the following two options (-u and -U) do the following |
| 458 | # - ignore valgrind output |
| 459 | # - filter out everything but lines right after the pattern occurances |
| 460 | # - keep one of each non-unique line |
| 461 | # - count how many lines remain |
| 462 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 463 | # if there were no duplicates. |
| 464 | "-U") |
| 465 | 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 |
| 466 | fail "lines following pattern '$2' must be unique in Server output" |
| 467 | return |
| 468 | fi |
| 469 | ;; |
| 470 | |
| 471 | "-u") |
| 472 | 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 |
| 473 | 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] | 474 | return |
| 475 | fi |
| 476 | ;; |
| 477 | |
| 478 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 479 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 480 | exit 1 |
| 481 | esac |
| 482 | shift 2 |
| 483 | done |
| 484 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 485 | # check valgrind's results |
| 486 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 487 | 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] | 488 | fail "Server has memory errors" |
| 489 | return |
| 490 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 491 | 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] | 492 | fail "Client has memory errors" |
| 493 | return |
| 494 | fi |
| 495 | fi |
| 496 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 497 | # if we're here, everything is ok |
| 498 | echo "PASS" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 499 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 500 | } |
| 501 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 502 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 503 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 504 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 505 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 506 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 507 | 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] | 508 | exit 1 |
| 509 | } |
| 510 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 511 | # |
| 512 | # MAIN |
| 513 | # |
| 514 | |
Manuel Pégourié-Gonnard | 19db8ea | 2015-03-10 13:41:04 +0000 | [diff] [blame] | 515 | if cd $( dirname $0 ); then :; else |
| 516 | echo "cd $( dirname $0 ) failed" >&2 |
| 517 | exit 1 |
| 518 | fi |
| 519 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 520 | get_options "$@" |
| 521 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 522 | # sanity checks, avoid an avalanche of errors |
| 523 | if [ ! -x "$P_SRV" ]; then |
| 524 | echo "Command '$P_SRV' is not an executable file" |
| 525 | exit 1 |
| 526 | fi |
| 527 | if [ ! -x "$P_CLI" ]; then |
| 528 | echo "Command '$P_CLI' is not an executable file" |
| 529 | exit 1 |
| 530 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 531 | if [ ! -x "$P_PXY" ]; then |
| 532 | echo "Command '$P_PXY' is not an executable file" |
| 533 | exit 1 |
| 534 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 535 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 536 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 537 | exit 1 |
| 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 540 | # used by watchdog |
| 541 | MAIN_PID="$$" |
| 542 | |
Manuel Pégourié-Gonnard | 3f69e54 | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 543 | # We use somewhat arbitrary delays for tests: |
| 544 | # - how long do we wait for the server to start (when lsof not available)? |
| 545 | # - how long do we allow for the client to finish? |
| 546 | # (not to check performance, just to avoid waiting indefinitely) |
| 547 | # Things are slower with valgrind, so give extra time here. |
| 548 | # |
| 549 | # Note: without lsof, there is a trade-off between the running time of this |
| 550 | # script and the risk of spurious errors because we didn't wait long enough. |
| 551 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 552 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 553 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 3f69e54 | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 554 | START_DELAY=6 |
| 555 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 556 | else |
Manuel Pégourié-Gonnard | 3f69e54 | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 557 | START_DELAY=2 |
| 558 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 559 | fi |
Manuel Pégourié-Gonnard | 3f69e54 | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 560 | |
| 561 | # some particular tests need more time: |
| 562 | # - for the client, we multiply the usual watchdog limit by a factor |
| 563 | # - for the server, we sleep for a number of seconds after the client exits |
| 564 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 565 | CLI_DELAY_FACTOR=1 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 566 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 567 | # Pick a "unique" server port in the range 10000-19999, and a proxy port |
| 568 | PORT_BASE="0000$$" |
Manuel Pégourié-Gonnard | 3a173f4 | 2015-01-22 13:30:33 +0000 | [diff] [blame] | 569 | PORT_BASE="$( printf $PORT_BASE | tail -c 4 )" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 570 | SRV_PORT="1$PORT_BASE" |
| 571 | PXY_PORT="2$PORT_BASE" |
| 572 | unset PORT_BASE |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 573 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 574 | # 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] | 575 | # +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] | 576 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 577 | 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] | 578 | 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] | 579 | 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] | 580 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 581 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 582 | G_CLI="$G_CLI -p +SRV_PORT localhost" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 583 | |
Gilles Peskine | 35db5ba | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 584 | # Allow SHA-1, because many of our test certificates use it |
| 585 | P_SRV="$P_SRV allow_sha1=1" |
| 586 | P_CLI="$P_CLI allow_sha1=1" |
| 587 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 588 | # Also pick a unique name for intermediate files |
| 589 | SRV_OUT="srv_out.$$" |
| 590 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 591 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 592 | SESSION="session.$$" |
| 593 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 594 | SKIP_NEXT="NO" |
| 595 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 596 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 597 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 598 | # Basic test |
| 599 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 600 | # Checks that: |
| 601 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 602 | # - the expected (highest security) parameters are selected |
| 603 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 604 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 605 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 606 | "$P_CLI" \ |
| 607 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 608 | -s "Protocol is TLSv1.2" \ |
| 609 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 610 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 611 | -s "ECDHE curve: secp521r1" \ |
| 612 | -S "error" \ |
| 613 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 614 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 615 | run_test "Default, DTLS" \ |
| 616 | "$P_SRV dtls=1" \ |
| 617 | "$P_CLI dtls=1" \ |
| 618 | 0 \ |
| 619 | -s "Protocol is DTLSv1.2" \ |
| 620 | -s "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" |
| 621 | |
Janos Follath | 6d3e338 | 2016-09-07 15:48:48 +0100 | [diff] [blame] | 622 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 623 | run_test "Unique IV in GCM" \ |
| 624 | "$P_SRV exchanges=20 debug_level=4" \ |
| 625 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 626 | 0 \ |
| 627 | -u "IV used" \ |
| 628 | -U "IV used" |
| 629 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 630 | # Tests for rc4 option |
| 631 | |
Simon Butcher | 6eb066e | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 632 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 633 | run_test "RC4: server disabled, client enabled" \ |
| 634 | "$P_SRV" \ |
| 635 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 636 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 637 | -s "SSL - The server has no ciphersuites in common" |
| 638 | |
Simon Butcher | 6eb066e | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 639 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 640 | run_test "RC4: server half, client enabled" \ |
| 641 | "$P_SRV arc4=1" \ |
| 642 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 643 | 1 \ |
| 644 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 645 | |
| 646 | run_test "RC4: server enabled, client disabled" \ |
| 647 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 648 | "$P_CLI" \ |
| 649 | 1 \ |
| 650 | -s "SSL - The server has no ciphersuites in common" |
| 651 | |
| 652 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 653 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 654 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 655 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 656 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 657 | -S "SSL - The server has no ciphersuites in common" |
| 658 | |
Hanno Becker | a24ed19 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 659 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 660 | |
| 661 | requires_gnutls |
| 662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 663 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 664 | "$G_SRV"\ |
| 665 | "$P_CLI force_version=tls1_1" \ |
| 666 | 0 |
| 667 | |
| 668 | requires_gnutls |
| 669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 670 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 671 | "$G_SRV"\ |
| 672 | "$P_CLI force_version=tls1" \ |
| 673 | 0 |
| 674 | |
Gilles Peskine | ae76599 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 675 | # Tests for SHA-1 support |
| 676 | |
Manuel Pégourié-Gonnard | 5539366 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 677 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | ae76599 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 678 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 679 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 680 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 681 | 1 \ |
| 682 | -c "The certificate is signed with an unacceptable hash" |
| 683 | |
Manuel Pégourié-Gonnard | 5539366 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 684 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 685 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 686 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 687 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 688 | 0 |
| 689 | |
Gilles Peskine | ae76599 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 690 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 691 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 692 | "$P_CLI allow_sha1=1" \ |
| 693 | 0 |
| 694 | |
| 695 | run_test "SHA-256 allowed by default in server certificate" \ |
| 696 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 697 | "$P_CLI allow_sha1=0" \ |
| 698 | 0 |
| 699 | |
Manuel Pégourié-Gonnard | 5539366 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 700 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | ae76599 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 701 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 702 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 703 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 704 | 1 \ |
| 705 | -s "The certificate is signed with an unacceptable hash" |
| 706 | |
Manuel Pégourié-Gonnard | 5539366 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 707 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 708 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 709 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 710 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 711 | 0 |
| 712 | |
Gilles Peskine | ae76599 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 713 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 714 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 715 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 716 | 0 |
| 717 | |
| 718 | run_test "SHA-256 allowed by default in client certificate" \ |
| 719 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 720 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 721 | 0 |
| 722 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 723 | # Tests for Truncated HMAC extension |
| 724 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 725 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 726 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 727 | "$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] | 728 | 0 \ |
Hanno Becker | ce516ff | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 729 | -s "dumping 'expected mac' (20 bytes)" \ |
| 730 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 731 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 732 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 733 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 734 | "$P_SRV debug_level=4" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 735 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 736 | 0 \ |
Hanno Becker | ce516ff | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 737 | -s "dumping 'expected mac' (20 bytes)" \ |
| 738 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 739 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 740 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 741 | run_test "Truncated HMAC: client enabled, server default" \ |
| 742 | "$P_SRV debug_level=4" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 743 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 744 | 0 \ |
Hanno Becker | ce516ff | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 745 | -s "dumping 'expected mac' (20 bytes)" \ |
| 746 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 747 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 748 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 749 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 750 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 751 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 752 | 0 \ |
Hanno Becker | ce516ff | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 753 | -s "dumping 'expected mac' (20 bytes)" \ |
| 754 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 755 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 756 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | d51bec7 | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 757 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 758 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 759 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | d51bec7 | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 760 | 0 \ |
| 761 | -s "dumping 'expected mac' (20 bytes)" \ |
| 762 | -S "dumping 'expected mac' (10 bytes)" |
| 763 | |
| 764 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 765 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 766 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 767 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 768 | 0 \ |
Hanno Becker | ce516ff | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 769 | -S "dumping 'expected mac' (20 bytes)" \ |
| 770 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 771 | |
Hanno Becker | 02f632e | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 772 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 773 | "$P_SRV dtls=1 debug_level=4" \ |
| 774 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 775 | 0 \ |
| 776 | -s "dumping 'expected mac' (20 bytes)" \ |
| 777 | -S "dumping 'expected mac' (10 bytes)" |
| 778 | |
| 779 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 780 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 781 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 782 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 02f632e | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 783 | 0 \ |
| 784 | -s "dumping 'expected mac' (20 bytes)" \ |
| 785 | -S "dumping 'expected mac' (10 bytes)" |
| 786 | |
| 787 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 788 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 789 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 790 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 02f632e | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 791 | 0 \ |
| 792 | -s "dumping 'expected mac' (20 bytes)" \ |
| 793 | -S "dumping 'expected mac' (10 bytes)" |
| 794 | |
| 795 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 796 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 797 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 798 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 02f632e | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 799 | 0 \ |
| 800 | -s "dumping 'expected mac' (20 bytes)" \ |
| 801 | -S "dumping 'expected mac' (10 bytes)" |
| 802 | |
| 803 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 804 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 805 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 806 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 02f632e | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 807 | 0 \ |
| 808 | -s "dumping 'expected mac' (20 bytes)" \ |
| 809 | -S "dumping 'expected mac' (10 bytes)" |
| 810 | |
| 811 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 812 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 813 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 814 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 815 | 0 \ |
| 816 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 817 | -s "dumping 'expected mac' (10 bytes)" |
| 818 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 819 | # Tests for Encrypt-then-MAC extension |
| 820 | |
| 821 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 822 | "$P_SRV debug_level=3 \ |
| 823 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 824 | "$P_CLI debug_level=3" \ |
| 825 | 0 \ |
| 826 | -c "client hello, adding encrypt_then_mac extension" \ |
| 827 | -s "found encrypt then mac extension" \ |
| 828 | -s "server hello, adding encrypt then mac extension" \ |
| 829 | -c "found encrypt_then_mac extension" \ |
| 830 | -c "using encrypt then mac" \ |
| 831 | -s "using encrypt then mac" |
| 832 | |
| 833 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 834 | "$P_SRV debug_level=3 etm=0 \ |
| 835 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 836 | "$P_CLI debug_level=3 etm=1" \ |
| 837 | 0 \ |
| 838 | -c "client hello, adding encrypt_then_mac extension" \ |
| 839 | -s "found encrypt then mac extension" \ |
| 840 | -S "server hello, adding encrypt then mac extension" \ |
| 841 | -C "found encrypt_then_mac extension" \ |
| 842 | -C "using encrypt then mac" \ |
| 843 | -S "using encrypt then mac" |
| 844 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 845 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 846 | "$P_SRV debug_level=3 etm=1 \ |
| 847 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 848 | "$P_CLI debug_level=3 etm=1" \ |
| 849 | 0 \ |
| 850 | -c "client hello, adding encrypt_then_mac extension" \ |
| 851 | -s "found encrypt then mac extension" \ |
| 852 | -S "server hello, adding encrypt then mac extension" \ |
| 853 | -C "found encrypt_then_mac extension" \ |
| 854 | -C "using encrypt then mac" \ |
| 855 | -S "using encrypt then mac" |
| 856 | |
| 857 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 858 | "$P_SRV debug_level=3 etm=1 \ |
| 859 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 860 | "$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] | 861 | 0 \ |
| 862 | -c "client hello, adding encrypt_then_mac extension" \ |
| 863 | -s "found encrypt then mac extension" \ |
| 864 | -S "server hello, adding encrypt then mac extension" \ |
| 865 | -C "found encrypt_then_mac extension" \ |
| 866 | -C "using encrypt then mac" \ |
| 867 | -S "using encrypt then mac" |
| 868 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 869 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 870 | "$P_SRV debug_level=3 etm=1 \ |
| 871 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 872 | "$P_CLI debug_level=3 etm=0" \ |
| 873 | 0 \ |
| 874 | -C "client hello, adding encrypt_then_mac extension" \ |
| 875 | -S "found encrypt then mac extension" \ |
| 876 | -S "server hello, adding encrypt then mac extension" \ |
| 877 | -C "found encrypt_then_mac extension" \ |
| 878 | -C "using encrypt then mac" \ |
| 879 | -S "using encrypt then mac" |
| 880 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 881 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 882 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 883 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 884 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 885 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 886 | 0 \ |
| 887 | -C "client hello, adding encrypt_then_mac extension" \ |
| 888 | -S "found encrypt then mac extension" \ |
| 889 | -S "server hello, adding encrypt then mac extension" \ |
| 890 | -C "found encrypt_then_mac extension" \ |
| 891 | -C "using encrypt then mac" \ |
| 892 | -S "using encrypt then mac" |
| 893 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 894 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 895 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 896 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 897 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 898 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 899 | 0 \ |
| 900 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | b700c46 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 901 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 902 | -S "server hello, adding encrypt then mac extension" \ |
| 903 | -C "found encrypt_then_mac extension" \ |
| 904 | -C "using encrypt then mac" \ |
| 905 | -S "using encrypt then mac" |
| 906 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 907 | # Tests for Extended Master Secret extension |
| 908 | |
| 909 | run_test "Extended Master Secret: default" \ |
| 910 | "$P_SRV debug_level=3" \ |
| 911 | "$P_CLI debug_level=3" \ |
| 912 | 0 \ |
| 913 | -c "client hello, adding extended_master_secret extension" \ |
| 914 | -s "found extended master secret extension" \ |
| 915 | -s "server hello, adding extended master secret extension" \ |
| 916 | -c "found extended_master_secret extension" \ |
| 917 | -c "using extended master secret" \ |
| 918 | -s "using extended master secret" |
| 919 | |
| 920 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 921 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 922 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 923 | 0 \ |
| 924 | -c "client hello, adding extended_master_secret extension" \ |
| 925 | -s "found extended master secret extension" \ |
| 926 | -S "server hello, adding extended master secret extension" \ |
| 927 | -C "found extended_master_secret extension" \ |
| 928 | -C "using extended master secret" \ |
| 929 | -S "using extended master secret" |
| 930 | |
| 931 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 932 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 933 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 934 | 0 \ |
| 935 | -C "client hello, adding extended_master_secret extension" \ |
| 936 | -S "found extended master secret extension" \ |
| 937 | -S "server hello, adding extended master secret extension" \ |
| 938 | -C "found extended_master_secret extension" \ |
| 939 | -C "using extended master secret" \ |
| 940 | -S "using extended master secret" |
| 941 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 942 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 943 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 944 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 945 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 946 | 0 \ |
| 947 | -C "client hello, adding extended_master_secret extension" \ |
| 948 | -S "found extended master secret extension" \ |
| 949 | -S "server hello, adding extended master secret extension" \ |
| 950 | -C "found extended_master_secret extension" \ |
| 951 | -C "using extended master secret" \ |
| 952 | -S "using extended master secret" |
| 953 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 954 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 955 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 956 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 957 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 958 | 0 \ |
| 959 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | b700c46 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 960 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 961 | -S "server hello, adding extended master secret extension" \ |
| 962 | -C "found extended_master_secret extension" \ |
| 963 | -C "using extended master secret" \ |
| 964 | -S "using extended master secret" |
| 965 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 966 | # Tests for FALLBACK_SCSV |
| 967 | |
| 968 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 969 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 970 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 971 | 0 \ |
| 972 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 973 | -S "received FALLBACK_SCSV" \ |
| 974 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 975 | -C "is a fatal alert message (msg 86)" |
| 976 | |
| 977 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 978 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 979 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 980 | 0 \ |
| 981 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 982 | -S "received FALLBACK_SCSV" \ |
| 983 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 984 | -C "is a fatal alert message (msg 86)" |
| 985 | |
| 986 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 987 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 988 | "$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] | 989 | 1 \ |
| 990 | -c "adding FALLBACK_SCSV" \ |
| 991 | -s "received FALLBACK_SCSV" \ |
| 992 | -s "inapropriate fallback" \ |
| 993 | -c "is a fatal alert message (msg 86)" |
| 994 | |
| 995 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 996 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 997 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 998 | 0 \ |
| 999 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1000 | -s "received FALLBACK_SCSV" \ |
| 1001 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1002 | -C "is a fatal alert message (msg 86)" |
| 1003 | |
| 1004 | requires_openssl_with_fallback_scsv |
| 1005 | run_test "Fallback SCSV: default, openssl server" \ |
| 1006 | "$O_SRV" \ |
| 1007 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1008 | 0 \ |
| 1009 | -C "adding FALLBACK_SCSV" \ |
| 1010 | -C "is a fatal alert message (msg 86)" |
| 1011 | |
| 1012 | requires_openssl_with_fallback_scsv |
| 1013 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1014 | "$O_SRV" \ |
| 1015 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1016 | 1 \ |
| 1017 | -c "adding FALLBACK_SCSV" \ |
| 1018 | -c "is a fatal alert message (msg 86)" |
| 1019 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1020 | requires_openssl_with_fallback_scsv |
| 1021 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1022 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1023 | "$O_CLI -tls1_1" \ |
| 1024 | 0 \ |
| 1025 | -S "received FALLBACK_SCSV" \ |
| 1026 | -S "inapropriate fallback" |
| 1027 | |
| 1028 | requires_openssl_with_fallback_scsv |
| 1029 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1030 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1031 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1032 | 1 \ |
| 1033 | -s "received FALLBACK_SCSV" \ |
| 1034 | -s "inapropriate fallback" |
| 1035 | |
| 1036 | requires_openssl_with_fallback_scsv |
| 1037 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1038 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1039 | "$O_CLI -fallback_scsv" \ |
| 1040 | 0 \ |
| 1041 | -s "received FALLBACK_SCSV" \ |
| 1042 | -S "inapropriate fallback" |
| 1043 | |
Andres Amaya Garcia | dc8b6df | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1044 | # Test sending and receiving empty application data records |
| 1045 | |
| 1046 | run_test "Encrypt then MAC: empty application data record" \ |
| 1047 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1048 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1049 | 0 \ |
| 1050 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1051 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1052 | -c "0 bytes written in 1 fragments" |
| 1053 | |
| 1054 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1055 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1056 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1057 | 0 \ |
| 1058 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1059 | -c "0 bytes written in 1 fragments" |
| 1060 | |
| 1061 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1062 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1063 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1064 | 0 \ |
| 1065 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1066 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1067 | -c "0 bytes written in 1 fragments" |
| 1068 | |
| 1069 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1070 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1071 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1072 | 0 \ |
| 1073 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1074 | -c "0 bytes written in 1 fragments" |
| 1075 | |
Gilles Peskine | 39e2981 | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1076 | ## ClientHello generated with |
| 1077 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1078 | ## then manually twiddling the ciphersuite list. |
| 1079 | ## The ClientHello content is spelled out below as a hex string as |
| 1080 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1081 | ## The expected response is an inappropriate_fallback alert. |
| 1082 | requires_openssl_with_fallback_scsv |
| 1083 | run_test "Fallback SCSV: beginning of list" \ |
| 1084 | "$P_SRV debug_level=2" \ |
| 1085 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1086 | 0 \ |
| 1087 | -s "received FALLBACK_SCSV" \ |
| 1088 | -s "inapropriate fallback" |
| 1089 | |
| 1090 | requires_openssl_with_fallback_scsv |
| 1091 | run_test "Fallback SCSV: end of list" \ |
| 1092 | "$P_SRV debug_level=2" \ |
| 1093 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1094 | 0 \ |
| 1095 | -s "received FALLBACK_SCSV" \ |
| 1096 | -s "inapropriate fallback" |
| 1097 | |
| 1098 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1099 | requires_openssl_with_fallback_scsv |
| 1100 | run_test "Fallback SCSV: not in list" \ |
| 1101 | "$P_SRV debug_level=2" \ |
| 1102 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1103 | 0 \ |
| 1104 | -S "received FALLBACK_SCSV" \ |
| 1105 | -S "inapropriate fallback" |
| 1106 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1107 | # Tests for CBC 1/n-1 record splitting |
| 1108 | |
| 1109 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1110 | "$P_SRV" \ |
| 1111 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1112 | request_size=123 force_version=tls1_2" \ |
| 1113 | 0 \ |
| 1114 | -s "Read from client: 123 bytes read" \ |
| 1115 | -S "Read from client: 1 bytes read" \ |
| 1116 | -S "122 bytes read" |
| 1117 | |
| 1118 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1119 | "$P_SRV" \ |
| 1120 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1121 | request_size=123 force_version=tls1_1" \ |
| 1122 | 0 \ |
| 1123 | -s "Read from client: 123 bytes read" \ |
| 1124 | -S "Read from client: 1 bytes read" \ |
| 1125 | -S "122 bytes read" |
| 1126 | |
| 1127 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1128 | "$P_SRV" \ |
| 1129 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1130 | request_size=123 force_version=tls1" \ |
| 1131 | 0 \ |
| 1132 | -S "Read from client: 123 bytes read" \ |
| 1133 | -s "Read from client: 1 bytes read" \ |
| 1134 | -s "122 bytes read" |
| 1135 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1136 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1137 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1138 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1139 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1140 | request_size=123 force_version=ssl3" \ |
| 1141 | 0 \ |
| 1142 | -S "Read from client: 123 bytes read" \ |
| 1143 | -s "Read from client: 1 bytes read" \ |
| 1144 | -s "122 bytes read" |
| 1145 | |
| 1146 | 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] | 1147 | "$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] | 1148 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1149 | request_size=123 force_version=tls1" \ |
| 1150 | 0 \ |
| 1151 | -s "Read from client: 123 bytes read" \ |
| 1152 | -S "Read from client: 1 bytes read" \ |
| 1153 | -S "122 bytes read" |
| 1154 | |
| 1155 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1156 | "$P_SRV" \ |
| 1157 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1158 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1159 | 0 \ |
| 1160 | -s "Read from client: 123 bytes read" \ |
| 1161 | -S "Read from client: 1 bytes read" \ |
| 1162 | -S "122 bytes read" |
| 1163 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1164 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1165 | "$P_SRV nbio=2" \ |
| 1166 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1167 | request_size=123 force_version=tls1" \ |
| 1168 | 0 \ |
| 1169 | -S "Read from client: 123 bytes read" \ |
| 1170 | -s "Read from client: 1 bytes read" \ |
| 1171 | -s "122 bytes read" |
| 1172 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1173 | # Tests for Session Tickets |
| 1174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1175 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1176 | "$P_SRV debug_level=3 tickets=1" \ |
| 1177 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1178 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1179 | -c "client hello, adding session ticket extension" \ |
| 1180 | -s "found session ticket extension" \ |
| 1181 | -s "server hello, adding session ticket extension" \ |
| 1182 | -c "found session_ticket extension" \ |
| 1183 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1184 | -S "session successfully restored from cache" \ |
| 1185 | -s "session successfully restored from ticket" \ |
| 1186 | -s "a session has been resumed" \ |
| 1187 | -c "a session has been resumed" |
| 1188 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1189 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1190 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1191 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1192 | 0 \ |
| 1193 | -c "client hello, adding session ticket extension" \ |
| 1194 | -s "found session ticket extension" \ |
| 1195 | -s "server hello, adding session ticket extension" \ |
| 1196 | -c "found session_ticket extension" \ |
| 1197 | -c "parse new session ticket" \ |
| 1198 | -S "session successfully restored from cache" \ |
| 1199 | -s "session successfully restored from ticket" \ |
| 1200 | -s "a session has been resumed" \ |
| 1201 | -c "a session has been resumed" |
| 1202 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1203 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1204 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1205 | "$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] | 1206 | 0 \ |
| 1207 | -c "client hello, adding session ticket extension" \ |
| 1208 | -s "found session ticket extension" \ |
| 1209 | -s "server hello, adding session ticket extension" \ |
| 1210 | -c "found session_ticket extension" \ |
| 1211 | -c "parse new session ticket" \ |
| 1212 | -S "session successfully restored from cache" \ |
| 1213 | -S "session successfully restored from ticket" \ |
| 1214 | -S "a session has been resumed" \ |
| 1215 | -C "a session has been resumed" |
| 1216 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1217 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1218 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1219 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1220 | 0 \ |
| 1221 | -c "client hello, adding session ticket extension" \ |
| 1222 | -c "found session_ticket extension" \ |
| 1223 | -c "parse new session ticket" \ |
| 1224 | -c "a session has been resumed" |
| 1225 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1226 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1227 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1228 | "( $O_CLI -sess_out $SESSION; \ |
| 1229 | $O_CLI -sess_in $SESSION; \ |
| 1230 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1231 | 0 \ |
| 1232 | -s "found session ticket extension" \ |
| 1233 | -s "server hello, adding session ticket extension" \ |
| 1234 | -S "session successfully restored from cache" \ |
| 1235 | -s "session successfully restored from ticket" \ |
| 1236 | -s "a session has been resumed" |
| 1237 | |
Hanno Becker | 16fe2fd | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1238 | # Tests for Session Tickets with DTLS |
| 1239 | |
| 1240 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1241 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1242 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1243 | 0 \ |
| 1244 | -c "client hello, adding session ticket extension" \ |
| 1245 | -s "found session ticket extension" \ |
| 1246 | -s "server hello, adding session ticket extension" \ |
| 1247 | -c "found session_ticket extension" \ |
| 1248 | -c "parse new session ticket" \ |
| 1249 | -S "session successfully restored from cache" \ |
| 1250 | -s "session successfully restored from ticket" \ |
| 1251 | -s "a session has been resumed" \ |
| 1252 | -c "a session has been resumed" |
| 1253 | |
| 1254 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1255 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 1256 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1257 | 0 \ |
| 1258 | -c "client hello, adding session ticket extension" \ |
| 1259 | -s "found session ticket extension" \ |
| 1260 | -s "server hello, adding session ticket extension" \ |
| 1261 | -c "found session_ticket extension" \ |
| 1262 | -c "parse new session ticket" \ |
| 1263 | -S "session successfully restored from cache" \ |
| 1264 | -s "session successfully restored from ticket" \ |
| 1265 | -s "a session has been resumed" \ |
| 1266 | -c "a session has been resumed" |
| 1267 | |
| 1268 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1269 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1270 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 1271 | 0 \ |
| 1272 | -c "client hello, adding session ticket extension" \ |
| 1273 | -s "found session ticket extension" \ |
| 1274 | -s "server hello, adding session ticket extension" \ |
| 1275 | -c "found session_ticket extension" \ |
| 1276 | -c "parse new session ticket" \ |
| 1277 | -S "session successfully restored from cache" \ |
| 1278 | -S "session successfully restored from ticket" \ |
| 1279 | -S "a session has been resumed" \ |
| 1280 | -C "a session has been resumed" |
| 1281 | |
| 1282 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1283 | "$O_SRV -dtls1" \ |
| 1284 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1285 | 0 \ |
| 1286 | -c "client hello, adding session ticket extension" \ |
| 1287 | -c "found session_ticket extension" \ |
| 1288 | -c "parse new session ticket" \ |
| 1289 | -c "a session has been resumed" |
| 1290 | |
| 1291 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1292 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1293 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1294 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1295 | rm -f $SESSION )" \ |
| 1296 | 0 \ |
| 1297 | -s "found session ticket extension" \ |
| 1298 | -s "server hello, adding session ticket extension" \ |
| 1299 | -S "session successfully restored from cache" \ |
| 1300 | -s "session successfully restored from ticket" \ |
| 1301 | -s "a session has been resumed" |
| 1302 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1303 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1305 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1306 | "$P_SRV debug_level=3 tickets=0" \ |
| 1307 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1308 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1309 | -c "client hello, adding session ticket extension" \ |
| 1310 | -s "found session ticket extension" \ |
| 1311 | -S "server hello, adding session ticket extension" \ |
| 1312 | -C "found session_ticket extension" \ |
| 1313 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1314 | -s "session successfully restored from cache" \ |
| 1315 | -S "session successfully restored from ticket" \ |
| 1316 | -s "a session has been resumed" \ |
| 1317 | -c "a session has been resumed" |
| 1318 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1319 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1320 | "$P_SRV debug_level=3 tickets=1" \ |
| 1321 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1322 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1323 | -C "client hello, adding session ticket extension" \ |
| 1324 | -S "found session ticket extension" \ |
| 1325 | -S "server hello, adding session ticket extension" \ |
| 1326 | -C "found session_ticket extension" \ |
| 1327 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1328 | -s "session successfully restored from cache" \ |
| 1329 | -S "session successfully restored from ticket" \ |
| 1330 | -s "a session has been resumed" \ |
| 1331 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1332 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1333 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1334 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1335 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1336 | 0 \ |
| 1337 | -S "session successfully restored from cache" \ |
| 1338 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1339 | -S "a session has been resumed" \ |
| 1340 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1342 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1343 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1344 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1345 | 0 \ |
| 1346 | -s "session successfully restored from cache" \ |
| 1347 | -S "session successfully restored from ticket" \ |
| 1348 | -s "a session has been resumed" \ |
| 1349 | -c "a session has been resumed" |
| 1350 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1351 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1352 | "$P_SRV debug_level=3 tickets=0" \ |
| 1353 | "$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] | 1354 | 0 \ |
| 1355 | -s "session successfully restored from cache" \ |
| 1356 | -S "session successfully restored from ticket" \ |
| 1357 | -s "a session has been resumed" \ |
| 1358 | -c "a session has been resumed" |
| 1359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1360 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1361 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1362 | "$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] | 1363 | 0 \ |
| 1364 | -S "session successfully restored from cache" \ |
| 1365 | -S "session successfully restored from ticket" \ |
| 1366 | -S "a session has been resumed" \ |
| 1367 | -C "a session has been resumed" |
| 1368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1369 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1370 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1371 | "$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] | 1372 | 0 \ |
| 1373 | -s "session successfully restored from cache" \ |
| 1374 | -S "session successfully restored from ticket" \ |
| 1375 | -s "a session has been resumed" \ |
| 1376 | -c "a session has been resumed" |
| 1377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1378 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1379 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1380 | "( $O_CLI -sess_out $SESSION; \ |
| 1381 | $O_CLI -sess_in $SESSION; \ |
| 1382 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1383 | 0 \ |
| 1384 | -s "found session ticket extension" \ |
| 1385 | -S "server hello, adding session ticket extension" \ |
| 1386 | -s "session successfully restored from cache" \ |
| 1387 | -S "session successfully restored from ticket" \ |
| 1388 | -s "a session has been resumed" |
| 1389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1390 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1391 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1392 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1393 | 0 \ |
| 1394 | -C "found session_ticket extension" \ |
| 1395 | -C "parse new session ticket" \ |
| 1396 | -c "a session has been resumed" |
| 1397 | |
Hanno Becker | 16fe2fd | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1398 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1399 | |
| 1400 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1401 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1402 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1403 | 0 \ |
| 1404 | -c "client hello, adding session ticket extension" \ |
| 1405 | -s "found session ticket extension" \ |
| 1406 | -S "server hello, adding session ticket extension" \ |
| 1407 | -C "found session_ticket extension" \ |
| 1408 | -C "parse new session ticket" \ |
| 1409 | -s "session successfully restored from cache" \ |
| 1410 | -S "session successfully restored from ticket" \ |
| 1411 | -s "a session has been resumed" \ |
| 1412 | -c "a session has been resumed" |
| 1413 | |
| 1414 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1415 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1416 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1417 | 0 \ |
| 1418 | -C "client hello, adding session ticket extension" \ |
| 1419 | -S "found session ticket extension" \ |
| 1420 | -S "server hello, adding session ticket extension" \ |
| 1421 | -C "found session_ticket extension" \ |
| 1422 | -C "parse new session ticket" \ |
| 1423 | -s "session successfully restored from cache" \ |
| 1424 | -S "session successfully restored from ticket" \ |
| 1425 | -s "a session has been resumed" \ |
| 1426 | -c "a session has been resumed" |
| 1427 | |
| 1428 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1429 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 1430 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1431 | 0 \ |
| 1432 | -S "session successfully restored from cache" \ |
| 1433 | -S "session successfully restored from ticket" \ |
| 1434 | -S "a session has been resumed" \ |
| 1435 | -C "a session has been resumed" |
| 1436 | |
| 1437 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1438 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 1439 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1440 | 0 \ |
| 1441 | -s "session successfully restored from cache" \ |
| 1442 | -S "session successfully restored from ticket" \ |
| 1443 | -s "a session has been resumed" \ |
| 1444 | -c "a session has been resumed" |
| 1445 | |
| 1446 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1447 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1448 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 1449 | 0 \ |
| 1450 | -s "session successfully restored from cache" \ |
| 1451 | -S "session successfully restored from ticket" \ |
| 1452 | -s "a session has been resumed" \ |
| 1453 | -c "a session has been resumed" |
| 1454 | |
| 1455 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1456 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 1457 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1458 | 0 \ |
| 1459 | -S "session successfully restored from cache" \ |
| 1460 | -S "session successfully restored from ticket" \ |
| 1461 | -S "a session has been resumed" \ |
| 1462 | -C "a session has been resumed" |
| 1463 | |
| 1464 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1465 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 1466 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1467 | 0 \ |
| 1468 | -s "session successfully restored from cache" \ |
| 1469 | -S "session successfully restored from ticket" \ |
| 1470 | -s "a session has been resumed" \ |
| 1471 | -c "a session has been resumed" |
| 1472 | |
| 1473 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1474 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1475 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1476 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1477 | rm -f $SESSION )" \ |
| 1478 | 0 \ |
| 1479 | -s "found session ticket extension" \ |
| 1480 | -S "server hello, adding session ticket extension" \ |
| 1481 | -s "session successfully restored from cache" \ |
| 1482 | -S "session successfully restored from ticket" \ |
| 1483 | -s "a session has been resumed" |
| 1484 | |
| 1485 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1486 | "$O_SRV -dtls1" \ |
| 1487 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1488 | 0 \ |
| 1489 | -C "found session_ticket extension" \ |
| 1490 | -C "parse new session ticket" \ |
| 1491 | -c "a session has been resumed" |
| 1492 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1493 | # Tests for Max Fragment Length extension |
| 1494 | |
Hanno Becker | 64691dc | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 1495 | MAX_CONTENT_LEN_EXPECT='16384' |
| 1496 | MAX_CONTENT_LEN_CONFIG=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN) |
| 1497 | |
| 1498 | if [ -n "$MAX_CONTENT_LEN_CONFIG" ] && [ "$MAX_CONTENT_LEN_CONFIG" -ne "$MAX_CONTENT_LEN_EXPECT" ]; then |
| 1499 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" |
| 1500 | printf "MBEDTLS_SSL_MAX_CONTENT_LEN that is different from the script’s\n" |
| 1501 | printf "test value of ${MAX_CONTENT_LEN_EXPECT}. \n" |
| 1502 | printf "\n" |
| 1503 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 1504 | printf "script should also be adjusted.\n" |
| 1505 | printf "\n" |
| 1506 | |
| 1507 | exit 1 |
| 1508 | fi |
| 1509 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1510 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1511 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1512 | "$P_SRV debug_level=3" \ |
| 1513 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1514 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1515 | -c "Maximum fragment length is 16384" \ |
| 1516 | -s "Maximum fragment length is 16384" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1517 | -C "client hello, adding max_fragment_length extension" \ |
| 1518 | -S "found max fragment length extension" \ |
| 1519 | -S "server hello, max_fragment_length extension" \ |
| 1520 | -C "found max_fragment_length extension" |
| 1521 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1522 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1523 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1524 | "$P_SRV debug_level=3" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1525 | "$P_CLI debug_level=3 request_size=16385" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1526 | 0 \ |
| 1527 | -c "Maximum fragment length is 16384" \ |
| 1528 | -s "Maximum fragment length is 16384" \ |
| 1529 | -C "client hello, adding max_fragment_length extension" \ |
| 1530 | -S "found max fragment length extension" \ |
| 1531 | -S "server hello, max_fragment_length extension" \ |
| 1532 | -C "found max_fragment_length extension" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1533 | -c "16385 bytes written in 2 fragments" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1534 | -s "16384 bytes read" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1535 | -s "1 bytes read" |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1536 | |
| 1537 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1538 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1539 | "$P_SRV debug_level=3 dtls=1" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1540 | "$P_CLI debug_level=3 dtls=1 request_size=16385" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1541 | 1 \ |
| 1542 | -c "Maximum fragment length is 16384" \ |
| 1543 | -s "Maximum fragment length is 16384" \ |
| 1544 | -C "client hello, adding max_fragment_length extension" \ |
| 1545 | -S "found max fragment length extension" \ |
| 1546 | -S "server hello, max_fragment_length extension" \ |
| 1547 | -C "found max_fragment_length extension" \ |
| 1548 | -c "fragment larger than.*maximum " |
| 1549 | |
| 1550 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1551 | run_test "Max fragment length: disabled, larger message" \ |
| 1552 | "$P_SRV debug_level=3" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1553 | "$P_CLI debug_level=3 request_size=16385" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1554 | 0 \ |
| 1555 | -C "Maximum fragment length is 16384" \ |
| 1556 | -S "Maximum fragment length is 16384" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1557 | -c "16385 bytes written in 2 fragments" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1558 | -s "16384 bytes read" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1559 | -s "1 bytes read" |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1560 | |
| 1561 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1562 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1563 | "$P_SRV debug_level=3 dtls=1" \ |
Hanno Becker | 6ed76f7 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1564 | "$P_CLI debug_level=3 dtls=1 request_size=16385" \ |
Hanno Becker | 2fabe5f | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1565 | 1 \ |
| 1566 | -C "Maximum fragment length is 16384" \ |
| 1567 | -S "Maximum fragment length is 16384" \ |
| 1568 | -c "fragment larger than.*maximum " |
| 1569 | |
| 1570 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1571 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1572 | "$P_SRV debug_level=3" \ |
| 1573 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1574 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1575 | -c "Maximum fragment length is 4096" \ |
| 1576 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1577 | -c "client hello, adding max_fragment_length extension" \ |
| 1578 | -s "found max fragment length extension" \ |
| 1579 | -s "server hello, max_fragment_length extension" \ |
| 1580 | -c "found max_fragment_length extension" |
| 1581 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1582 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1583 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1584 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1585 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1586 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1587 | -c "Maximum fragment length is 16384" \ |
| 1588 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1589 | -C "client hello, adding max_fragment_length extension" \ |
| 1590 | -S "found max fragment length extension" \ |
| 1591 | -S "server hello, max_fragment_length extension" \ |
| 1592 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1593 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1594 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1595 | requires_gnutls |
| 1596 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1597 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1598 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1599 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1600 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1601 | -c "client hello, adding max_fragment_length extension" \ |
| 1602 | -c "found max_fragment_length extension" |
| 1603 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1604 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1605 | run_test "Max fragment length: client, message just fits" \ |
| 1606 | "$P_SRV debug_level=3" \ |
| 1607 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1608 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1609 | -c "Maximum fragment length is 2048" \ |
| 1610 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1611 | -c "client hello, adding max_fragment_length extension" \ |
| 1612 | -s "found max fragment length extension" \ |
| 1613 | -s "server hello, max_fragment_length extension" \ |
| 1614 | -c "found max_fragment_length extension" \ |
| 1615 | -c "2048 bytes written in 1 fragments" \ |
| 1616 | -s "2048 bytes read" |
| 1617 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1618 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1619 | run_test "Max fragment length: client, larger message" \ |
| 1620 | "$P_SRV debug_level=3" \ |
| 1621 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1622 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1623 | -c "Maximum fragment length is 2048" \ |
| 1624 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1625 | -c "client hello, adding max_fragment_length extension" \ |
| 1626 | -s "found max fragment length extension" \ |
| 1627 | -s "server hello, max_fragment_length extension" \ |
| 1628 | -c "found max_fragment_length extension" \ |
| 1629 | -c "2345 bytes written in 2 fragments" \ |
| 1630 | -s "2048 bytes read" \ |
| 1631 | -s "297 bytes read" |
| 1632 | |
Hanno Becker | 0560778 | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1633 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1634 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1635 | "$P_SRV debug_level=3 dtls=1" \ |
| 1636 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1637 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1638 | -c "Maximum fragment length is 2048" \ |
| 1639 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1640 | -c "client hello, adding max_fragment_length extension" \ |
| 1641 | -s "found max fragment length extension" \ |
| 1642 | -s "server hello, max_fragment_length extension" \ |
| 1643 | -c "found max_fragment_length extension" \ |
| 1644 | -c "fragment larger than.*maximum" |
| 1645 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1646 | # Tests for renegotiation |
| 1647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1648 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1649 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1650 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1651 | 0 \ |
| 1652 | -C "client hello, adding renegotiation extension" \ |
| 1653 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1654 | -S "found renegotiation extension" \ |
| 1655 | -s "server hello, secure renegotiation extension" \ |
| 1656 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1657 | -C "=> renegotiate" \ |
| 1658 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1659 | -S "write hello request" |
| 1660 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1661 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1662 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1663 | "$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] | 1664 | "$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] | 1665 | 0 \ |
| 1666 | -c "client hello, adding renegotiation extension" \ |
| 1667 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1668 | -s "found renegotiation extension" \ |
| 1669 | -s "server hello, secure renegotiation extension" \ |
| 1670 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1671 | -c "=> renegotiate" \ |
| 1672 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1673 | -S "write hello request" |
| 1674 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1676 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1677 | "$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] | 1678 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1679 | 0 \ |
| 1680 | -c "client hello, adding renegotiation extension" \ |
| 1681 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1682 | -s "found renegotiation extension" \ |
| 1683 | -s "server hello, secure renegotiation extension" \ |
| 1684 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1685 | -c "=> renegotiate" \ |
| 1686 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1687 | -s "write hello request" |
| 1688 | |
Janos Follath | 5f1dd80 | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1689 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1690 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1691 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | 5f1dd80 | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1693 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 1694 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 1695 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 1696 | 0 \ |
| 1697 | -c "client hello, adding renegotiation extension" \ |
| 1698 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1699 | -s "found renegotiation extension" \ |
| 1700 | -s "server hello, secure renegotiation extension" \ |
| 1701 | -c "found renegotiation extension" \ |
| 1702 | -c "=> renegotiate" \ |
| 1703 | -s "=> renegotiate" \ |
| 1704 | -S "write hello request" \ |
| 1705 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1706 | |
| 1707 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 1708 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 1709 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1710 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | 5f1dd80 | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1711 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 1712 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 1713 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1714 | 0 \ |
| 1715 | -c "client hello, adding renegotiation extension" \ |
| 1716 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1717 | -s "found renegotiation extension" \ |
| 1718 | -s "server hello, secure renegotiation extension" \ |
| 1719 | -c "found renegotiation extension" \ |
| 1720 | -c "=> renegotiate" \ |
| 1721 | -s "=> renegotiate" \ |
| 1722 | -s "write hello request" \ |
| 1723 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 1724 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1725 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1726 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1727 | "$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] | 1728 | "$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] | 1729 | 0 \ |
| 1730 | -c "client hello, adding renegotiation extension" \ |
| 1731 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1732 | -s "found renegotiation extension" \ |
| 1733 | -s "server hello, secure renegotiation extension" \ |
| 1734 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1735 | -c "=> renegotiate" \ |
| 1736 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1737 | -s "write hello request" |
| 1738 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1740 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1741 | "$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] | 1742 | "$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] | 1743 | 1 \ |
| 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1749 | -c "=> renegotiate" \ |
| 1750 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1751 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1752 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1753 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1754 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1756 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1757 | "$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] | 1758 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1759 | 0 \ |
| 1760 | -C "client hello, adding renegotiation extension" \ |
| 1761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1762 | -S "found renegotiation extension" \ |
| 1763 | -s "server hello, secure renegotiation extension" \ |
| 1764 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1765 | -C "=> renegotiate" \ |
| 1766 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1767 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1768 | -S "SSL - An unexpected message was received from our peer" \ |
| 1769 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1770 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1771 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1772 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1773 | "$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] | 1774 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1775 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1776 | 0 \ |
| 1777 | -C "client hello, adding renegotiation extension" \ |
| 1778 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1779 | -S "found renegotiation extension" \ |
| 1780 | -s "server hello, secure renegotiation extension" \ |
| 1781 | -c "found renegotiation extension" \ |
| 1782 | -C "=> renegotiate" \ |
| 1783 | -S "=> renegotiate" \ |
| 1784 | -s "write hello request" \ |
| 1785 | -S "SSL - An unexpected message was received from our peer" \ |
| 1786 | -S "failed" |
| 1787 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1788 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1789 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1790 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1791 | "$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] | 1792 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1793 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1794 | 0 \ |
| 1795 | -C "client hello, adding renegotiation extension" \ |
| 1796 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1797 | -S "found renegotiation extension" \ |
| 1798 | -s "server hello, secure renegotiation extension" \ |
| 1799 | -c "found renegotiation extension" \ |
| 1800 | -C "=> renegotiate" \ |
| 1801 | -S "=> renegotiate" \ |
| 1802 | -s "write hello request" \ |
| 1803 | -S "SSL - An unexpected message was received from our peer" \ |
| 1804 | -S "failed" |
| 1805 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1806 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1807 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1808 | "$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] | 1809 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1810 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1811 | 0 \ |
| 1812 | -C "client hello, adding renegotiation extension" \ |
| 1813 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1814 | -S "found renegotiation extension" \ |
| 1815 | -s "server hello, secure renegotiation extension" \ |
| 1816 | -c "found renegotiation extension" \ |
| 1817 | -C "=> renegotiate" \ |
| 1818 | -S "=> renegotiate" \ |
| 1819 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1820 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1821 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1823 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1824 | "$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] | 1825 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1826 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1827 | 0 \ |
| 1828 | -c "client hello, adding renegotiation extension" \ |
| 1829 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1830 | -s "found renegotiation extension" \ |
| 1831 | -s "server hello, secure renegotiation extension" \ |
| 1832 | -c "found renegotiation extension" \ |
| 1833 | -c "=> renegotiate" \ |
| 1834 | -s "=> renegotiate" \ |
| 1835 | -s "write hello request" \ |
| 1836 | -S "SSL - An unexpected message was received from our peer" \ |
| 1837 | -S "failed" |
| 1838 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1839 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1840 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1841 | "$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] | 1842 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 1843 | 0 \ |
| 1844 | -C "client hello, adding renegotiation extension" \ |
| 1845 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1846 | -S "found renegotiation extension" \ |
| 1847 | -s "server hello, secure renegotiation extension" \ |
| 1848 | -c "found renegotiation extension" \ |
| 1849 | -S "record counter limit reached: renegotiate" \ |
| 1850 | -C "=> renegotiate" \ |
| 1851 | -S "=> renegotiate" \ |
| 1852 | -S "write hello request" \ |
| 1853 | -S "SSL - An unexpected message was received from our peer" \ |
| 1854 | -S "failed" |
| 1855 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1856 | # one extra exchange to be able to complete renego |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1857 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1858 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1859 | "$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] | 1860 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1861 | 0 \ |
| 1862 | -c "client hello, adding renegotiation extension" \ |
| 1863 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1864 | -s "found renegotiation extension" \ |
| 1865 | -s "server hello, secure renegotiation extension" \ |
| 1866 | -c "found renegotiation extension" \ |
| 1867 | -s "record counter limit reached: renegotiate" \ |
| 1868 | -c "=> renegotiate" \ |
| 1869 | -s "=> renegotiate" \ |
| 1870 | -s "write hello request" \ |
| 1871 | -S "SSL - An unexpected message was received from our peer" \ |
| 1872 | -S "failed" |
| 1873 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1874 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1875 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1876 | "$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] | 1877 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1878 | 0 \ |
| 1879 | -c "client hello, adding renegotiation extension" \ |
| 1880 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1881 | -s "found renegotiation extension" \ |
| 1882 | -s "server hello, secure renegotiation extension" \ |
| 1883 | -c "found renegotiation extension" \ |
| 1884 | -s "record counter limit reached: renegotiate" \ |
| 1885 | -c "=> renegotiate" \ |
| 1886 | -s "=> renegotiate" \ |
| 1887 | -s "write hello request" \ |
| 1888 | -S "SSL - An unexpected message was received from our peer" \ |
| 1889 | -S "failed" |
| 1890 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1892 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1893 | "$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] | 1894 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 1895 | 0 \ |
| 1896 | -C "client hello, adding renegotiation extension" \ |
| 1897 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1898 | -S "found renegotiation extension" \ |
| 1899 | -s "server hello, secure renegotiation extension" \ |
| 1900 | -c "found renegotiation extension" \ |
| 1901 | -S "record counter limit reached: renegotiate" \ |
| 1902 | -C "=> renegotiate" \ |
| 1903 | -S "=> renegotiate" \ |
| 1904 | -S "write hello request" \ |
| 1905 | -S "SSL - An unexpected message was received from our peer" \ |
| 1906 | -S "failed" |
| 1907 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1908 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1909 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1910 | "$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] | 1911 | "$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] | 1912 | 0 \ |
| 1913 | -c "client hello, adding renegotiation extension" \ |
| 1914 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1915 | -s "found renegotiation extension" \ |
| 1916 | -s "server hello, secure renegotiation extension" \ |
| 1917 | -c "found renegotiation extension" \ |
| 1918 | -c "=> renegotiate" \ |
| 1919 | -s "=> renegotiate" \ |
| 1920 | -S "write hello request" |
| 1921 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1922 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1923 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1924 | "$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] | 1925 | "$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] | 1926 | 0 \ |
| 1927 | -c "client hello, adding renegotiation extension" \ |
| 1928 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1929 | -s "found renegotiation extension" \ |
| 1930 | -s "server hello, secure renegotiation extension" \ |
| 1931 | -c "found renegotiation extension" \ |
| 1932 | -c "=> renegotiate" \ |
| 1933 | -s "=> renegotiate" \ |
| 1934 | -s "write hello request" |
| 1935 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1936 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1937 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 1938 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1939 | "$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] | 1940 | 0 \ |
| 1941 | -c "client hello, adding renegotiation extension" \ |
| 1942 | -c "found renegotiation extension" \ |
| 1943 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1944 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1945 | -C "error" \ |
| 1946 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1947 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1948 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1949 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1950 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 1951 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1952 | "$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] | 1953 | 0 \ |
| 1954 | -c "client hello, adding renegotiation extension" \ |
| 1955 | -c "found renegotiation extension" \ |
| 1956 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1957 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 1958 | -C "error" \ |
| 1959 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 1960 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1961 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1962 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1963 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 1964 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1965 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 1966 | 1 \ |
| 1967 | -c "client hello, adding renegotiation extension" \ |
| 1968 | -C "found renegotiation extension" \ |
| 1969 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1970 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1971 | -c "error" \ |
| 1972 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1973 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1974 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1975 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1976 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 1977 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1978 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1979 | allow_legacy=0" \ |
| 1980 | 1 \ |
| 1981 | -c "client hello, adding renegotiation extension" \ |
| 1982 | -C "found renegotiation extension" \ |
| 1983 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 1984 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1985 | -c "error" \ |
| 1986 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 1987 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 1988 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 1990 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 1991 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 1992 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 1993 | allow_legacy=1" \ |
| 1994 | 0 \ |
| 1995 | -c "client hello, adding renegotiation extension" \ |
| 1996 | -C "found renegotiation extension" \ |
| 1997 | -c "=> renegotiate" \ |
| 1998 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 1999 | -C "error" \ |
| 2000 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2001 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 2002 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2003 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2004 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2005 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2006 | 0 \ |
| 2007 | -c "client hello, adding renegotiation extension" \ |
| 2008 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2009 | -s "found renegotiation extension" \ |
| 2010 | -s "server hello, secure renegotiation extension" \ |
| 2011 | -c "found renegotiation extension" \ |
| 2012 | -c "=> renegotiate" \ |
| 2013 | -s "=> renegotiate" \ |
| 2014 | -S "write hello request" |
| 2015 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2017 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2018 | "$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] | 2019 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2020 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2021 | 0 \ |
| 2022 | -c "client hello, adding renegotiation extension" \ |
| 2023 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2024 | -s "found renegotiation extension" \ |
| 2025 | -s "server hello, secure renegotiation extension" \ |
| 2026 | -c "found renegotiation extension" \ |
| 2027 | -c "=> renegotiate" \ |
| 2028 | -s "=> renegotiate" \ |
| 2029 | -s "write hello request" |
| 2030 | |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 9b1927b | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2032 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2033 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2034 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2035 | 0 \ |
| 2036 | -c "client hello, adding renegotiation extension" \ |
| 2037 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2038 | -s "found renegotiation extension" \ |
| 2039 | -s "server hello, secure renegotiation extension" \ |
| 2040 | -s "record counter limit reached: renegotiate" \ |
| 2041 | -c "=> renegotiate" \ |
| 2042 | -s "=> renegotiate" \ |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 2043 | -s "write hello request" |
Andres AG | 9b1927b | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2044 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2045 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2047 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2048 | "$G_SRV -u --mtu 4096" \ |
| 2049 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2050 | 0 \ |
| 2051 | -c "client hello, adding renegotiation extension" \ |
| 2052 | -c "found renegotiation extension" \ |
| 2053 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2054 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2055 | -C "error" \ |
| 2056 | -s "Extra-header:" |
| 2057 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2058 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2059 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2060 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2061 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2062 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2063 | "$P_CLI debug_level=3" \ |
| 2064 | 0 \ |
| 2065 | -c "found renegotiation extension" \ |
| 2066 | -C "error" \ |
| 2067 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2068 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2069 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2070 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2071 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2072 | "$P_CLI debug_level=3" \ |
| 2073 | 0 \ |
| 2074 | -C "found renegotiation extension" \ |
| 2075 | -C "error" \ |
| 2076 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2077 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2078 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2079 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2080 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2081 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2082 | 1 \ |
| 2083 | -C "found renegotiation extension" \ |
| 2084 | -c "error" \ |
| 2085 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2086 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2087 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2088 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2089 | "$P_SRV debug_level=3" \ |
| 2090 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2091 | 0 \ |
| 2092 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2093 | -s "server hello, secure renegotiation extension" |
| 2094 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2095 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2096 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2097 | "$P_SRV debug_level=3" \ |
| 2098 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2099 | 0 \ |
| 2100 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2101 | -S "server hello, secure renegotiation extension" |
| 2102 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2103 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2104 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2105 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
| 2106 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2107 | 1 \ |
| 2108 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2109 | -S "server hello, secure renegotiation extension" |
| 2110 | |
Janos Follath | 365b226 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2111 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2112 | |
| 2113 | requires_gnutls |
| 2114 | run_test "DER format: no trailing bytes" \ |
| 2115 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2116 | key_file=data_files/server5.key" \ |
| 2117 | "$G_CLI " \ |
| 2118 | 0 \ |
| 2119 | -c "Handshake was completed" \ |
| 2120 | |
| 2121 | requires_gnutls |
| 2122 | run_test "DER format: with a trailing zero byte" \ |
| 2123 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2124 | key_file=data_files/server5.key" \ |
| 2125 | "$G_CLI " \ |
| 2126 | 0 \ |
| 2127 | -c "Handshake was completed" \ |
| 2128 | |
| 2129 | requires_gnutls |
| 2130 | run_test "DER format: with a trailing random byte" \ |
| 2131 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2132 | key_file=data_files/server5.key" \ |
| 2133 | "$G_CLI " \ |
| 2134 | 0 \ |
| 2135 | -c "Handshake was completed" \ |
| 2136 | |
| 2137 | requires_gnutls |
| 2138 | run_test "DER format: with 2 trailing random bytes" \ |
| 2139 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2140 | key_file=data_files/server5.key" \ |
| 2141 | "$G_CLI " \ |
| 2142 | 0 \ |
| 2143 | -c "Handshake was completed" \ |
| 2144 | |
| 2145 | requires_gnutls |
| 2146 | run_test "DER format: with 4 trailing random bytes" \ |
| 2147 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2148 | key_file=data_files/server5.key" \ |
| 2149 | "$G_CLI " \ |
| 2150 | 0 \ |
| 2151 | -c "Handshake was completed" \ |
| 2152 | |
| 2153 | requires_gnutls |
| 2154 | run_test "DER format: with 8 trailing random bytes" \ |
| 2155 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2156 | key_file=data_files/server5.key" \ |
| 2157 | "$G_CLI " \ |
| 2158 | 0 \ |
| 2159 | -c "Handshake was completed" \ |
| 2160 | |
| 2161 | requires_gnutls |
| 2162 | run_test "DER format: with 9 trailing random bytes" \ |
| 2163 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2164 | key_file=data_files/server5.key" \ |
| 2165 | "$G_CLI " \ |
| 2166 | 0 \ |
| 2167 | -c "Handshake was completed" \ |
| 2168 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2169 | # Tests for auth_mode |
| 2170 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2171 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2172 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2173 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2174 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2175 | 1 \ |
| 2176 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2177 | -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] | 2178 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2179 | -c "X509 - Certificate verification failed" |
| 2180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2181 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2182 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2183 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2184 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2185 | 0 \ |
| 2186 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2187 | -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] | 2188 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2189 | -C "X509 - Certificate verification failed" |
| 2190 | |
Hanno Becker | 61c0c70 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2191 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2192 | "$P_SRV" \ |
| 2193 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2194 | 0 \ |
| 2195 | -c "x509_verify_cert() returned" \ |
| 2196 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2197 | -c "! Certificate verification flags"\ |
| 2198 | -C "! mbedtls_ssl_handshake returned" \ |
| 2199 | -C "X509 - Certificate verification failed" \ |
| 2200 | -C "SSL - No CA Chain is set, but required to operate" |
| 2201 | |
| 2202 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2203 | "$P_SRV" \ |
| 2204 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2205 | 1 \ |
| 2206 | -c "x509_verify_cert() returned" \ |
| 2207 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2208 | -c "! Certificate verification flags"\ |
| 2209 | -c "! mbedtls_ssl_handshake returned" \ |
| 2210 | -c "SSL - No CA Chain is set, but required to operate" |
| 2211 | |
| 2212 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2213 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2214 | # the client informs the server about the supported curves - it does, though, in the |
| 2215 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2216 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2217 | # different means to have the server ignoring the client's supported curve list. |
| 2218 | |
| 2219 | requires_config_enabled MBEDTLS_ECP_C |
| 2220 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2221 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2222 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2223 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2224 | 1 \ |
| 2225 | -c "bad certificate (EC key curve)"\ |
| 2226 | -c "! Certificate verification flags"\ |
| 2227 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2228 | |
| 2229 | requires_config_enabled MBEDTLS_ECP_C |
| 2230 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2231 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2232 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2233 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2234 | 1 \ |
| 2235 | -c "bad certificate (EC key curve)"\ |
| 2236 | -c "! Certificate verification flags"\ |
| 2237 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2238 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2239 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2240 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2241 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2242 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2243 | 0 \ |
| 2244 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2245 | -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] | 2246 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2247 | -C "X509 - Certificate verification failed" |
| 2248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2249 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2250 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2251 | "$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] | 2252 | key_file=data_files/server5.key" \ |
| 2253 | 1 \ |
| 2254 | -S "skip write certificate request" \ |
| 2255 | -C "skip parse certificate request" \ |
| 2256 | -c "got a certificate request" \ |
| 2257 | -C "skip write certificate" \ |
| 2258 | -C "skip write certificate verify" \ |
| 2259 | -S "skip parse certificate verify" \ |
| 2260 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2261 | -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] | 2262 | -s "! mbedtls_ssl_handshake returned" \ |
| 2263 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2264 | -s "X509 - Certificate verification failed" |
| 2265 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2266 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2267 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2268 | "$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] | 2269 | key_file=data_files/server5.key" \ |
| 2270 | 0 \ |
| 2271 | -S "skip write certificate request" \ |
| 2272 | -C "skip parse certificate request" \ |
| 2273 | -c "got a certificate request" \ |
| 2274 | -C "skip write certificate" \ |
| 2275 | -C "skip write certificate verify" \ |
| 2276 | -S "skip parse certificate verify" \ |
| 2277 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2278 | -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] | 2279 | -S "! mbedtls_ssl_handshake returned" \ |
| 2280 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2281 | -S "X509 - Certificate verification failed" |
| 2282 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2283 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2284 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2285 | "$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] | 2286 | key_file=data_files/server5.key" \ |
| 2287 | 0 \ |
| 2288 | -s "skip write certificate request" \ |
| 2289 | -C "skip parse certificate request" \ |
| 2290 | -c "got no certificate request" \ |
| 2291 | -c "skip write certificate" \ |
| 2292 | -c "skip write certificate verify" \ |
| 2293 | -s "skip parse certificate verify" \ |
| 2294 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2295 | -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] | 2296 | -S "! mbedtls_ssl_handshake returned" \ |
| 2297 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2298 | -S "X509 - Certificate verification failed" |
| 2299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2300 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2301 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2302 | "$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] | 2303 | 0 \ |
| 2304 | -S "skip write certificate request" \ |
| 2305 | -C "skip parse certificate request" \ |
| 2306 | -c "got a certificate request" \ |
| 2307 | -C "skip write certificate$" \ |
| 2308 | -C "got no certificate to send" \ |
| 2309 | -S "SSLv3 client has no certificate" \ |
| 2310 | -c "skip write certificate verify" \ |
| 2311 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2312 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2313 | -S "! mbedtls_ssl_handshake returned" \ |
| 2314 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2315 | -S "X509 - Certificate verification failed" |
| 2316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2317 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2318 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2319 | "$O_CLI" \ |
| 2320 | 0 \ |
| 2321 | -S "skip write certificate request" \ |
| 2322 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2323 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2324 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2325 | -S "X509 - Certificate verification failed" |
| 2326 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2327 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2328 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2329 | "$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] | 2330 | 0 \ |
| 2331 | -C "skip parse certificate request" \ |
| 2332 | -c "got a certificate request" \ |
| 2333 | -C "skip write certificate$" \ |
| 2334 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2335 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2336 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2338 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2339 | "$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] | 2340 | "$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] | 2341 | 0 \ |
| 2342 | -S "skip write certificate request" \ |
| 2343 | -C "skip parse certificate request" \ |
| 2344 | -c "got a certificate request" \ |
| 2345 | -C "skip write certificate$" \ |
| 2346 | -c "skip write certificate verify" \ |
| 2347 | -c "got no certificate to send" \ |
| 2348 | -s "SSLv3 client has no certificate" \ |
| 2349 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2350 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2351 | -S "! mbedtls_ssl_handshake returned" \ |
| 2352 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2353 | -S "X509 - Certificate verification failed" |
| 2354 | |
Manuel Pégourié-Gonnard | 591035d | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2355 | run_test "Authentication: server max_int chain, client default" \ |
| 2356 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2357 | key_file=data_files/dir-maxpath/09.key" \ |
| 2358 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2359 | 0 \ |
| 2360 | -C "X509 - A fatal error occured" |
| 2361 | |
| 2362 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2363 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2364 | key_file=data_files/dir-maxpath/10.key" \ |
| 2365 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2366 | 1 \ |
| 2367 | -c "X509 - A fatal error occured" |
| 2368 | |
| 2369 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2370 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2371 | key_file=data_files/dir-maxpath/10.key" \ |
| 2372 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2373 | auth_mode=optional" \ |
| 2374 | 1 \ |
| 2375 | -c "X509 - A fatal error occured" |
| 2376 | |
| 2377 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2378 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2379 | key_file=data_files/dir-maxpath/10.key" \ |
| 2380 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2381 | auth_mode=none" \ |
| 2382 | 0 \ |
| 2383 | -C "X509 - A fatal error occured" |
| 2384 | |
| 2385 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2386 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2387 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2388 | key_file=data_files/dir-maxpath/10.key" \ |
| 2389 | 0 \ |
| 2390 | -S "X509 - A fatal error occured" |
| 2391 | |
| 2392 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2393 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2394 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2395 | key_file=data_files/dir-maxpath/10.key" \ |
| 2396 | 1 \ |
| 2397 | -s "X509 - A fatal error occured" |
| 2398 | |
| 2399 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2400 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2401 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2402 | key_file=data_files/dir-maxpath/10.key" \ |
| 2403 | 1 \ |
| 2404 | -s "X509 - A fatal error occured" |
| 2405 | |
| 2406 | run_test "Authentication: client max_int chain, server required" \ |
| 2407 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2408 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2409 | key_file=data_files/dir-maxpath/09.key" \ |
| 2410 | 0 \ |
| 2411 | -S "X509 - A fatal error occured" |
| 2412 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2413 | # Tests for certificate selection based on SHA verson |
| 2414 | |
| 2415 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2416 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2417 | key_file=data_files/server5.key \ |
| 2418 | crt_file2=data_files/server5-sha1.crt \ |
| 2419 | key_file2=data_files/server5.key" \ |
| 2420 | "$P_CLI force_version=tls1_2" \ |
| 2421 | 0 \ |
| 2422 | -c "signed using.*ECDSA with SHA256" \ |
| 2423 | -C "signed using.*ECDSA with SHA1" |
| 2424 | |
| 2425 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2426 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2427 | key_file=data_files/server5.key \ |
| 2428 | crt_file2=data_files/server5-sha1.crt \ |
| 2429 | key_file2=data_files/server5.key" \ |
| 2430 | "$P_CLI force_version=tls1_1" \ |
| 2431 | 0 \ |
| 2432 | -C "signed using.*ECDSA with SHA256" \ |
| 2433 | -c "signed using.*ECDSA with SHA1" |
| 2434 | |
| 2435 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2436 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2437 | key_file=data_files/server5.key \ |
| 2438 | crt_file2=data_files/server5-sha1.crt \ |
| 2439 | key_file2=data_files/server5.key" \ |
| 2440 | "$P_CLI force_version=tls1" \ |
| 2441 | 0 \ |
| 2442 | -C "signed using.*ECDSA with SHA256" \ |
| 2443 | -c "signed using.*ECDSA with SHA1" |
| 2444 | |
| 2445 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2446 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2447 | key_file=data_files/server5.key \ |
| 2448 | crt_file2=data_files/server6.crt \ |
| 2449 | key_file2=data_files/server6.key" \ |
| 2450 | "$P_CLI force_version=tls1_1" \ |
| 2451 | 0 \ |
| 2452 | -c "serial number.*09" \ |
| 2453 | -c "signed using.*ECDSA with SHA256" \ |
| 2454 | -C "signed using.*ECDSA with SHA1" |
| 2455 | |
| 2456 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2457 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2458 | key_file=data_files/server6.key \ |
| 2459 | crt_file2=data_files/server5.crt \ |
| 2460 | key_file2=data_files/server5.key" \ |
| 2461 | "$P_CLI force_version=tls1_1" \ |
| 2462 | 0 \ |
| 2463 | -c "serial number.*0A" \ |
| 2464 | -c "signed using.*ECDSA with SHA256" \ |
| 2465 | -C "signed using.*ECDSA with SHA1" |
| 2466 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2467 | # tests for SNI |
| 2468 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2469 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2470 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2471 | 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] | 2472 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2473 | 0 \ |
| 2474 | -S "parse ServerName extension" \ |
| 2475 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2476 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2477 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2478 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2479 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2480 | 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] | 2481 | 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] | 2482 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2483 | 0 \ |
| 2484 | -s "parse ServerName extension" \ |
| 2485 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2486 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2488 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2489 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2490 | 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] | 2491 | 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] | 2492 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2493 | 0 \ |
| 2494 | -s "parse ServerName extension" \ |
| 2495 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2496 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2497 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2498 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2499 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2500 | 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] | 2501 | 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] | 2502 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2503 | 1 \ |
| 2504 | -s "parse ServerName extension" \ |
| 2505 | -s "ssl_sni_wrapper() returned" \ |
| 2506 | -s "mbedtls_ssl_handshake returned" \ |
| 2507 | -c "mbedtls_ssl_handshake returned" \ |
| 2508 | -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] | 2509 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2510 | run_test "SNI: client auth no override: optional" \ |
| 2511 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2512 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2513 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2514 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2515 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2516 | -S "skip write certificate request" \ |
| 2517 | -C "skip parse certificate request" \ |
| 2518 | -c "got a certificate request" \ |
| 2519 | -C "skip write certificate" \ |
| 2520 | -C "skip write certificate verify" \ |
| 2521 | -S "skip parse certificate verify" |
| 2522 | |
| 2523 | run_test "SNI: client auth override: none -> optional" \ |
| 2524 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2525 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2526 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2527 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2528 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2529 | -S "skip write certificate request" \ |
| 2530 | -C "skip parse certificate request" \ |
| 2531 | -c "got a certificate request" \ |
| 2532 | -C "skip write certificate" \ |
| 2533 | -C "skip write certificate verify" \ |
| 2534 | -S "skip parse certificate verify" |
| 2535 | |
| 2536 | run_test "SNI: client auth override: optional -> none" \ |
| 2537 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2538 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2539 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2540 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2541 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2542 | -s "skip write certificate request" \ |
| 2543 | -C "skip parse certificate request" \ |
| 2544 | -c "got no certificate request" \ |
| 2545 | -c "skip write certificate" \ |
| 2546 | -c "skip write certificate verify" \ |
| 2547 | -s "skip parse certificate verify" |
| 2548 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2549 | run_test "SNI: CA no override" \ |
| 2550 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2551 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2552 | ca_file=data_files/test-ca.crt \ |
| 2553 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2554 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2555 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2556 | 1 \ |
| 2557 | -S "skip write certificate request" \ |
| 2558 | -C "skip parse certificate request" \ |
| 2559 | -c "got a certificate request" \ |
| 2560 | -C "skip write certificate" \ |
| 2561 | -C "skip write certificate verify" \ |
| 2562 | -S "skip parse certificate verify" \ |
| 2563 | -s "x509_verify_cert() returned" \ |
| 2564 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2565 | -S "The certificate has been revoked (is on a CRL)" |
| 2566 | |
| 2567 | run_test "SNI: CA override" \ |
| 2568 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2569 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2570 | ca_file=data_files/test-ca.crt \ |
| 2571 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2572 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2573 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2574 | 0 \ |
| 2575 | -S "skip write certificate request" \ |
| 2576 | -C "skip parse certificate request" \ |
| 2577 | -c "got a certificate request" \ |
| 2578 | -C "skip write certificate" \ |
| 2579 | -C "skip write certificate verify" \ |
| 2580 | -S "skip parse certificate verify" \ |
| 2581 | -S "x509_verify_cert() returned" \ |
| 2582 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2583 | -S "The certificate has been revoked (is on a CRL)" |
| 2584 | |
| 2585 | run_test "SNI: CA override with CRL" \ |
| 2586 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2587 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2588 | ca_file=data_files/test-ca.crt \ |
| 2589 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2590 | "$P_CLI debug_level=3 server_name=localhost \ |
| 2591 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2592 | 1 \ |
| 2593 | -S "skip write certificate request" \ |
| 2594 | -C "skip parse certificate request" \ |
| 2595 | -c "got a certificate request" \ |
| 2596 | -C "skip write certificate" \ |
| 2597 | -C "skip write certificate verify" \ |
| 2598 | -S "skip parse certificate verify" \ |
| 2599 | -s "x509_verify_cert() returned" \ |
| 2600 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2601 | -s "The certificate has been revoked (is on a CRL)" |
| 2602 | |
Andres AG | 52142f1 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2603 | # Tests for SNI and DTLS |
| 2604 | |
Andres Amaya Garcia | 0b8eaa8 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2605 | run_test "SNI: DTLS, no SNI callback" \ |
| 2606 | "$P_SRV debug_level=3 dtls=1 \ |
| 2607 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2608 | "$P_CLI server_name=localhost dtls=1" \ |
| 2609 | 0 \ |
| 2610 | -S "parse ServerName extension" \ |
| 2611 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2612 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2613 | |
Andres Amaya Garcia | 021ad3d | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2614 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 52142f1 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2615 | "$P_SRV debug_level=3 dtls=1 \ |
| 2616 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2617 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2618 | "$P_CLI server_name=localhost dtls=1" \ |
| 2619 | 0 \ |
| 2620 | -s "parse ServerName extension" \ |
| 2621 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2622 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 2623 | |
Andres Amaya Garcia | 0b8eaa8 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2624 | run_test "SNI: DTLS, matching cert 2" \ |
| 2625 | "$P_SRV debug_level=3 dtls=1 \ |
| 2626 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2627 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2628 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 2629 | 0 \ |
| 2630 | -s "parse ServerName extension" \ |
| 2631 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2632 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 2633 | |
| 2634 | run_test "SNI: DTLS, no matching cert" \ |
| 2635 | "$P_SRV debug_level=3 dtls=1 \ |
| 2636 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2637 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 2638 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 2639 | 1 \ |
| 2640 | -s "parse ServerName extension" \ |
| 2641 | -s "ssl_sni_wrapper() returned" \ |
| 2642 | -s "mbedtls_ssl_handshake returned" \ |
| 2643 | -c "mbedtls_ssl_handshake returned" \ |
| 2644 | -c "SSL - A fatal alert message was received from our peer" |
| 2645 | |
| 2646 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 2647 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2648 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2649 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2650 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2651 | 0 \ |
| 2652 | -S "skip write certificate request" \ |
| 2653 | -C "skip parse certificate request" \ |
| 2654 | -c "got a certificate request" \ |
| 2655 | -C "skip write certificate" \ |
| 2656 | -C "skip write certificate verify" \ |
| 2657 | -S "skip parse certificate verify" |
| 2658 | |
| 2659 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 2660 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 2661 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2662 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2663 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2664 | 0 \ |
| 2665 | -S "skip write certificate request" \ |
| 2666 | -C "skip parse certificate request" \ |
| 2667 | -c "got a certificate request" \ |
| 2668 | -C "skip write certificate" \ |
| 2669 | -C "skip write certificate verify" \ |
| 2670 | -S "skip parse certificate verify" |
| 2671 | |
| 2672 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 2673 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2674 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2675 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2676 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 2677 | 0 \ |
| 2678 | -s "skip write certificate request" \ |
| 2679 | -C "skip parse certificate request" \ |
| 2680 | -c "got no certificate request" \ |
| 2681 | -c "skip write certificate" \ |
| 2682 | -c "skip write certificate verify" \ |
| 2683 | -s "skip parse certificate verify" |
| 2684 | |
Simon Butcher | 12826df | 2018-06-16 19:46:52 +0100 | [diff] [blame] | 2685 | needs_more_time 4 |
Andres Amaya Garcia | 0b8eaa8 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2686 | run_test "SNI: DTLS, CA no override" \ |
| 2687 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2688 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2689 | ca_file=data_files/test-ca.crt \ |
| 2690 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 2691 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2692 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2693 | 1 \ |
| 2694 | -S "skip write certificate request" \ |
| 2695 | -C "skip parse certificate request" \ |
| 2696 | -c "got a certificate request" \ |
| 2697 | -C "skip write certificate" \ |
| 2698 | -C "skip write certificate verify" \ |
| 2699 | -S "skip parse certificate verify" \ |
| 2700 | -s "x509_verify_cert() returned" \ |
| 2701 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2702 | -S "The certificate has been revoked (is on a CRL)" |
| 2703 | |
Andres Amaya Garcia | 021ad3d | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2704 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 52142f1 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2705 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 2706 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2707 | ca_file=data_files/test-ca.crt \ |
| 2708 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 2709 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2710 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2711 | 0 \ |
| 2712 | -S "skip write certificate request" \ |
| 2713 | -C "skip parse certificate request" \ |
| 2714 | -c "got a certificate request" \ |
| 2715 | -C "skip write certificate" \ |
| 2716 | -C "skip write certificate verify" \ |
| 2717 | -S "skip parse certificate verify" \ |
| 2718 | -S "x509_verify_cert() returned" \ |
| 2719 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2720 | -S "The certificate has been revoked (is on a CRL)" |
| 2721 | |
Simon Butcher | 12826df | 2018-06-16 19:46:52 +0100 | [diff] [blame] | 2722 | needs_more_time 4 |
Andres Amaya Garcia | 021ad3d | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2723 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 52142f1 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2724 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2725 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 2726 | ca_file=data_files/test-ca.crt \ |
| 2727 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 2728 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 2729 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 2730 | 1 \ |
| 2731 | -S "skip write certificate request" \ |
| 2732 | -C "skip parse certificate request" \ |
| 2733 | -c "got a certificate request" \ |
| 2734 | -C "skip write certificate" \ |
| 2735 | -C "skip write certificate verify" \ |
| 2736 | -S "skip parse certificate verify" \ |
| 2737 | -s "x509_verify_cert() returned" \ |
| 2738 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 2739 | -s "The certificate has been revoked (is on a CRL)" |
| 2740 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2741 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 2742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2743 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2744 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2745 | "$P_CLI nbio=2 tickets=0" \ |
| 2746 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2747 | -S "mbedtls_ssl_handshake returned" \ |
| 2748 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2749 | -c "Read from server: .* bytes read" |
| 2750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2751 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2752 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 2753 | "$P_CLI nbio=2 tickets=0" \ |
| 2754 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2755 | -S "mbedtls_ssl_handshake returned" \ |
| 2756 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2757 | -c "Read from server: .* bytes read" |
| 2758 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2759 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2760 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2761 | "$P_CLI nbio=2 tickets=1" \ |
| 2762 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2763 | -S "mbedtls_ssl_handshake returned" \ |
| 2764 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2765 | -c "Read from server: .* bytes read" |
| 2766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2767 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2768 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2769 | "$P_CLI nbio=2 tickets=1" \ |
| 2770 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2771 | -S "mbedtls_ssl_handshake returned" \ |
| 2772 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2773 | -c "Read from server: .* bytes read" |
| 2774 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2775 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2776 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 2777 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2778 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2779 | -S "mbedtls_ssl_handshake returned" \ |
| 2780 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2781 | -c "Read from server: .* bytes read" |
| 2782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2783 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2784 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 2785 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 2786 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2787 | -S "mbedtls_ssl_handshake returned" \ |
| 2788 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2789 | -c "Read from server: .* bytes read" |
| 2790 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2791 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2792 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 2793 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 2794 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2795 | -S "mbedtls_ssl_handshake returned" \ |
| 2796 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2797 | -c "Read from server: .* bytes read" |
| 2798 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2799 | # Tests for version negotiation |
| 2800 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2801 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2802 | "$P_SRV" \ |
| 2803 | "$P_CLI" \ |
| 2804 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2805 | -S "mbedtls_ssl_handshake returned" \ |
| 2806 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2807 | -s "Protocol is TLSv1.2" \ |
| 2808 | -c "Protocol is TLSv1.2" |
| 2809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2810 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2811 | "$P_SRV" \ |
| 2812 | "$P_CLI max_version=tls1_1" \ |
| 2813 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2814 | -S "mbedtls_ssl_handshake returned" \ |
| 2815 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2816 | -s "Protocol is TLSv1.1" \ |
| 2817 | -c "Protocol is TLSv1.1" |
| 2818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2819 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2820 | "$P_SRV max_version=tls1_1" \ |
| 2821 | "$P_CLI" \ |
| 2822 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2823 | -S "mbedtls_ssl_handshake returned" \ |
| 2824 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2825 | -s "Protocol is TLSv1.1" \ |
| 2826 | -c "Protocol is TLSv1.1" |
| 2827 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2828 | 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] | 2829 | "$P_SRV max_version=tls1_1" \ |
| 2830 | "$P_CLI max_version=tls1_1" \ |
| 2831 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2832 | -S "mbedtls_ssl_handshake returned" \ |
| 2833 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2834 | -s "Protocol is TLSv1.1" \ |
| 2835 | -c "Protocol is TLSv1.1" |
| 2836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2837 | 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] | 2838 | "$P_SRV min_version=tls1_1" \ |
| 2839 | "$P_CLI max_version=tls1_1" \ |
| 2840 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2841 | -S "mbedtls_ssl_handshake returned" \ |
| 2842 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2843 | -s "Protocol is TLSv1.1" \ |
| 2844 | -c "Protocol is TLSv1.1" |
| 2845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2846 | 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] | 2847 | "$P_SRV max_version=tls1_1" \ |
| 2848 | "$P_CLI min_version=tls1_1" \ |
| 2849 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2850 | -S "mbedtls_ssl_handshake returned" \ |
| 2851 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2852 | -s "Protocol is TLSv1.1" \ |
| 2853 | -c "Protocol is TLSv1.1" |
| 2854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2855 | 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] | 2856 | "$P_SRV max_version=tls1_1" \ |
| 2857 | "$P_CLI min_version=tls1_2" \ |
| 2858 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2859 | -s "mbedtls_ssl_handshake returned" \ |
| 2860 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2861 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 2862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2863 | 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] | 2864 | "$P_SRV min_version=tls1_2" \ |
| 2865 | "$P_CLI max_version=tls1_1" \ |
| 2866 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2867 | -s "mbedtls_ssl_handshake returned" \ |
| 2868 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 2869 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 2870 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2871 | # Tests for ALPN extension |
| 2872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2873 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2874 | "$P_SRV debug_level=3" \ |
| 2875 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2876 | 0 \ |
| 2877 | -C "client hello, adding alpn extension" \ |
| 2878 | -S "found alpn extension" \ |
| 2879 | -C "got an alert message, type: \\[2:120]" \ |
| 2880 | -S "server hello, adding alpn extension" \ |
| 2881 | -C "found alpn extension " \ |
| 2882 | -C "Application Layer Protocol is" \ |
| 2883 | -S "Application Layer Protocol is" |
| 2884 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2885 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2886 | "$P_SRV debug_level=3" \ |
| 2887 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2888 | 0 \ |
| 2889 | -c "client hello, adding alpn extension" \ |
| 2890 | -s "found alpn extension" \ |
| 2891 | -C "got an alert message, type: \\[2:120]" \ |
| 2892 | -S "server hello, adding alpn extension" \ |
| 2893 | -C "found alpn extension " \ |
| 2894 | -c "Application Layer Protocol is (none)" \ |
| 2895 | -S "Application Layer Protocol is" |
| 2896 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2897 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2898 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2899 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2900 | 0 \ |
| 2901 | -C "client hello, adding alpn extension" \ |
| 2902 | -S "found alpn extension" \ |
| 2903 | -C "got an alert message, type: \\[2:120]" \ |
| 2904 | -S "server hello, adding alpn extension" \ |
| 2905 | -C "found alpn extension " \ |
| 2906 | -C "Application Layer Protocol is" \ |
| 2907 | -s "Application Layer Protocol is (none)" |
| 2908 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2909 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2910 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2911 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2912 | 0 \ |
| 2913 | -c "client hello, adding alpn extension" \ |
| 2914 | -s "found alpn extension" \ |
| 2915 | -C "got an alert message, type: \\[2:120]" \ |
| 2916 | -s "server hello, adding alpn extension" \ |
| 2917 | -c "found alpn extension" \ |
| 2918 | -c "Application Layer Protocol is abc" \ |
| 2919 | -s "Application Layer Protocol is abc" |
| 2920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2921 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2922 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2923 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2924 | 0 \ |
| 2925 | -c "client hello, adding alpn extension" \ |
| 2926 | -s "found alpn extension" \ |
| 2927 | -C "got an alert message, type: \\[2:120]" \ |
| 2928 | -s "server hello, adding alpn extension" \ |
| 2929 | -c "found alpn extension" \ |
| 2930 | -c "Application Layer Protocol is abc" \ |
| 2931 | -s "Application Layer Protocol is abc" |
| 2932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2933 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2934 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 2935 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2936 | 0 \ |
| 2937 | -c "client hello, adding alpn extension" \ |
| 2938 | -s "found alpn extension" \ |
| 2939 | -C "got an alert message, type: \\[2:120]" \ |
| 2940 | -s "server hello, adding alpn extension" \ |
| 2941 | -c "found alpn extension" \ |
| 2942 | -c "Application Layer Protocol is 1234" \ |
| 2943 | -s "Application Layer Protocol is 1234" |
| 2944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2945 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2946 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 2947 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 2948 | 1 \ |
| 2949 | -c "client hello, adding alpn extension" \ |
| 2950 | -s "found alpn extension" \ |
| 2951 | -c "got an alert message, type: \\[2:120]" \ |
| 2952 | -S "server hello, adding alpn extension" \ |
| 2953 | -C "found alpn extension" \ |
| 2954 | -C "Application Layer Protocol is 1234" \ |
| 2955 | -S "Application Layer Protocol is 1234" |
| 2956 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 2957 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2958 | # Tests for keyUsage in leaf certificates, part 1: |
| 2959 | # server-side certificate/suite selection |
| 2960 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2961 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2962 | "$P_SRV key_file=data_files/server2.key \ |
| 2963 | crt_file=data_files/server2.ku-ds.crt" \ |
| 2964 | "$P_CLI" \ |
| 2965 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 2966 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2967 | |
| 2968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2969 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2970 | "$P_SRV key_file=data_files/server2.key \ |
| 2971 | crt_file=data_files/server2.ku-ke.crt" \ |
| 2972 | "$P_CLI" \ |
| 2973 | 0 \ |
| 2974 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 2975 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2976 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2977 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2978 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2979 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2980 | 1 \ |
| 2981 | -C "Ciphersuite is " |
| 2982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2983 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2984 | "$P_SRV key_file=data_files/server5.key \ |
| 2985 | crt_file=data_files/server5.ku-ds.crt" \ |
| 2986 | "$P_CLI" \ |
| 2987 | 0 \ |
| 2988 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 2989 | |
| 2990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2991 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 2992 | "$P_SRV key_file=data_files/server5.key \ |
| 2993 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2994 | "$P_CLI" \ |
| 2995 | 0 \ |
| 2996 | -c "Ciphersuite is TLS-ECDH-" |
| 2997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2998 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 2999 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3000 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3001 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3002 | 1 \ |
| 3003 | -C "Ciphersuite is " |
| 3004 | |
| 3005 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3006 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3008 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3009 | "$O_SRV -key data_files/server2.key \ |
| 3010 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3011 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3012 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3013 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3014 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3015 | -C "Processing of the Certificate handshake message failed" \ |
| 3016 | -c "Ciphersuite is TLS-" |
| 3017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3018 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3019 | "$O_SRV -key data_files/server2.key \ |
| 3020 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3021 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3022 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3023 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3024 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3025 | -C "Processing of the Certificate handshake message failed" \ |
| 3026 | -c "Ciphersuite is TLS-" |
| 3027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3028 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3029 | "$O_SRV -key data_files/server2.key \ |
| 3030 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3031 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3032 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3033 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3034 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3035 | -C "Processing of the Certificate handshake message failed" \ |
| 3036 | -c "Ciphersuite is TLS-" |
| 3037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3038 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3039 | "$O_SRV -key data_files/server2.key \ |
| 3040 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3041 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3042 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3043 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3044 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3045 | -c "Processing of the Certificate handshake message failed" \ |
| 3046 | -C "Ciphersuite is TLS-" |
| 3047 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3048 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3049 | "$O_SRV -key data_files/server2.key \ |
| 3050 | -cert data_files/server2.ku-ke.crt" \ |
| 3051 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3052 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3053 | 0 \ |
| 3054 | -c "bad certificate (usage extensions)" \ |
| 3055 | -C "Processing of the Certificate handshake message failed" \ |
| 3056 | -c "Ciphersuite is TLS-" \ |
| 3057 | -c "! Usage does not match the keyUsage extension" |
| 3058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3059 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3060 | "$O_SRV -key data_files/server2.key \ |
| 3061 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3062 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3063 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3064 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3065 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3066 | -C "Processing of the Certificate handshake message failed" \ |
| 3067 | -c "Ciphersuite is TLS-" |
| 3068 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3069 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3070 | "$O_SRV -key data_files/server2.key \ |
| 3071 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3072 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3073 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3074 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3075 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3076 | -c "Processing of the Certificate handshake message failed" \ |
| 3077 | -C "Ciphersuite is TLS-" |
| 3078 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3079 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3080 | "$O_SRV -key data_files/server2.key \ |
| 3081 | -cert data_files/server2.ku-ds.crt" \ |
| 3082 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3083 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3084 | 0 \ |
| 3085 | -c "bad certificate (usage extensions)" \ |
| 3086 | -C "Processing of the Certificate handshake message failed" \ |
| 3087 | -c "Ciphersuite is TLS-" \ |
| 3088 | -c "! Usage does not match the keyUsage extension" |
| 3089 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3090 | # Tests for keyUsage in leaf certificates, part 3: |
| 3091 | # server-side checking of client cert |
| 3092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3093 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3094 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3095 | "$O_CLI -key data_files/server2.key \ |
| 3096 | -cert data_files/server2.ku-ds.crt" \ |
| 3097 | 0 \ |
| 3098 | -S "bad certificate (usage extensions)" \ |
| 3099 | -S "Processing of the Certificate handshake message failed" |
| 3100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3101 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3102 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3103 | "$O_CLI -key data_files/server2.key \ |
| 3104 | -cert data_files/server2.ku-ke.crt" \ |
| 3105 | 0 \ |
| 3106 | -s "bad certificate (usage extensions)" \ |
| 3107 | -S "Processing of the Certificate handshake message failed" |
| 3108 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3109 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3110 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3111 | "$O_CLI -key data_files/server2.key \ |
| 3112 | -cert data_files/server2.ku-ke.crt" \ |
| 3113 | 1 \ |
| 3114 | -s "bad certificate (usage extensions)" \ |
| 3115 | -s "Processing of the Certificate handshake message failed" |
| 3116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3117 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3118 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3119 | "$O_CLI -key data_files/server5.key \ |
| 3120 | -cert data_files/server5.ku-ds.crt" \ |
| 3121 | 0 \ |
| 3122 | -S "bad certificate (usage extensions)" \ |
| 3123 | -S "Processing of the Certificate handshake message failed" |
| 3124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3126 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3127 | "$O_CLI -key data_files/server5.key \ |
| 3128 | -cert data_files/server5.ku-ka.crt" \ |
| 3129 | 0 \ |
| 3130 | -s "bad certificate (usage extensions)" \ |
| 3131 | -S "Processing of the Certificate handshake message failed" |
| 3132 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3133 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3134 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3135 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3136 | "$P_SRV key_file=data_files/server5.key \ |
| 3137 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3138 | "$P_CLI" \ |
| 3139 | 0 |
| 3140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3141 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3142 | "$P_SRV key_file=data_files/server5.key \ |
| 3143 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3144 | "$P_CLI" \ |
| 3145 | 0 |
| 3146 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3147 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3148 | "$P_SRV key_file=data_files/server5.key \ |
| 3149 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3150 | "$P_CLI" \ |
| 3151 | 0 |
| 3152 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3153 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3154 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3155 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3156 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3157 | 1 |
| 3158 | |
| 3159 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3161 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3162 | "$O_SRV -key data_files/server5.key \ |
| 3163 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3164 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3165 | 0 \ |
| 3166 | -C "bad certificate (usage extensions)" \ |
| 3167 | -C "Processing of the Certificate handshake message failed" \ |
| 3168 | -c "Ciphersuite is TLS-" |
| 3169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3170 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3171 | "$O_SRV -key data_files/server5.key \ |
| 3172 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3173 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3174 | 0 \ |
| 3175 | -C "bad certificate (usage extensions)" \ |
| 3176 | -C "Processing of the Certificate handshake message failed" \ |
| 3177 | -c "Ciphersuite is TLS-" |
| 3178 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3179 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3180 | "$O_SRV -key data_files/server5.key \ |
| 3181 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3182 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3183 | 0 \ |
| 3184 | -C "bad certificate (usage extensions)" \ |
| 3185 | -C "Processing of the Certificate handshake message failed" \ |
| 3186 | -c "Ciphersuite is TLS-" |
| 3187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3188 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3189 | "$O_SRV -key data_files/server5.key \ |
| 3190 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3191 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3192 | 1 \ |
| 3193 | -c "bad certificate (usage extensions)" \ |
| 3194 | -c "Processing of the Certificate handshake message failed" \ |
| 3195 | -C "Ciphersuite is TLS-" |
| 3196 | |
| 3197 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3199 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3200 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3201 | "$O_CLI -key data_files/server5.key \ |
| 3202 | -cert data_files/server5.eku-cli.crt" \ |
| 3203 | 0 \ |
| 3204 | -S "bad certificate (usage extensions)" \ |
| 3205 | -S "Processing of the Certificate handshake message failed" |
| 3206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3207 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3208 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3209 | "$O_CLI -key data_files/server5.key \ |
| 3210 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3211 | 0 \ |
| 3212 | -S "bad certificate (usage extensions)" \ |
| 3213 | -S "Processing of the Certificate handshake message failed" |
| 3214 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3215 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3216 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3217 | "$O_CLI -key data_files/server5.key \ |
| 3218 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3219 | 0 \ |
| 3220 | -S "bad certificate (usage extensions)" \ |
| 3221 | -S "Processing of the Certificate handshake message failed" |
| 3222 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3223 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3224 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3225 | "$O_CLI -key data_files/server5.key \ |
| 3226 | -cert data_files/server5.eku-cs.crt" \ |
| 3227 | 0 \ |
| 3228 | -s "bad certificate (usage extensions)" \ |
| 3229 | -S "Processing of the Certificate handshake message failed" |
| 3230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3231 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3232 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3233 | "$O_CLI -key data_files/server5.key \ |
| 3234 | -cert data_files/server5.eku-cs.crt" \ |
| 3235 | 1 \ |
| 3236 | -s "bad certificate (usage extensions)" \ |
| 3237 | -s "Processing of the Certificate handshake message failed" |
| 3238 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3239 | # Tests for DHM parameters loading |
| 3240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3241 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3242 | "$P_SRV" \ |
| 3243 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3244 | debug_level=3" \ |
| 3245 | 0 \ |
| 3246 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 80e0d46 | 2017-10-13 16:51:54 +0100 | [diff] [blame] | 3247 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3249 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3250 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3251 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3252 | debug_level=3" \ |
| 3253 | 0 \ |
| 3254 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3255 | -c "value of 'DHM: G ' (2 bits)" |
| 3256 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3257 | # Tests for DHM client-side size checking |
| 3258 | |
| 3259 | run_test "DHM size: server default, client default, OK" \ |
| 3260 | "$P_SRV" \ |
| 3261 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3262 | debug_level=1" \ |
| 3263 | 0 \ |
| 3264 | -C "DHM prime too short:" |
| 3265 | |
| 3266 | run_test "DHM size: server default, client 2048, OK" \ |
| 3267 | "$P_SRV" \ |
| 3268 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3269 | debug_level=1 dhmlen=2048" \ |
| 3270 | 0 \ |
| 3271 | -C "DHM prime too short:" |
| 3272 | |
| 3273 | run_test "DHM size: server 1024, client default, OK" \ |
| 3274 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3275 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3276 | debug_level=1" \ |
| 3277 | 0 \ |
| 3278 | -C "DHM prime too short:" |
| 3279 | |
| 3280 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3281 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3282 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3283 | debug_level=1" \ |
| 3284 | 1 \ |
| 3285 | -c "DHM prime too short:" |
| 3286 | |
| 3287 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3288 | "$P_SRV" \ |
| 3289 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3290 | debug_level=1 dhmlen=2049" \ |
| 3291 | 1 \ |
| 3292 | -c "DHM prime too short:" |
| 3293 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3294 | # Tests for PSK callback |
| 3295 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3296 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3297 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3298 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3299 | psk_identity=foo psk=abc123" \ |
| 3300 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3301 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3302 | -S "SSL - Unknown identity received" \ |
| 3303 | -S "SSL - Verification of the message MAC failed" |
| 3304 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3305 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3306 | "$P_SRV" \ |
| 3307 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3308 | psk_identity=foo psk=abc123" \ |
| 3309 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3310 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3311 | -S "SSL - Unknown identity received" \ |
| 3312 | -S "SSL - Verification of the message MAC failed" |
| 3313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3314 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3315 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3316 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3317 | psk_identity=foo psk=abc123" \ |
| 3318 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3319 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3320 | -s "SSL - Unknown identity received" \ |
| 3321 | -S "SSL - Verification of the message MAC failed" |
| 3322 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3323 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3324 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3325 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3326 | psk_identity=abc psk=dead" \ |
| 3327 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3328 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3329 | -S "SSL - Unknown identity received" \ |
| 3330 | -S "SSL - Verification of the message MAC failed" |
| 3331 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3332 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3333 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3334 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3335 | psk_identity=def psk=beef" \ |
| 3336 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3337 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3338 | -S "SSL - Unknown identity received" \ |
| 3339 | -S "SSL - Verification of the message MAC failed" |
| 3340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3341 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3342 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3343 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3344 | psk_identity=ghi psk=beef" \ |
| 3345 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3346 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3347 | -s "SSL - Unknown identity received" \ |
| 3348 | -S "SSL - Verification of the message MAC failed" |
| 3349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3350 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3351 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3352 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3353 | psk_identity=abc psk=beef" \ |
| 3354 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3355 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3356 | -S "SSL - Unknown identity received" \ |
| 3357 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3358 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3359 | # Tests for ciphersuites per version |
| 3360 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3362 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3363 | "$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] | 3364 | "$P_CLI force_version=ssl3" \ |
| 3365 | 0 \ |
| 3366 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" |
| 3367 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3368 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3369 | "$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] | 3370 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3371 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3372 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3374 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3375 | "$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] | 3376 | "$P_CLI force_version=tls1_1" \ |
| 3377 | 0 \ |
| 3378 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 3379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3380 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3381 | "$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] | 3382 | "$P_CLI force_version=tls1_2" \ |
| 3383 | 0 \ |
| 3384 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 3385 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3386 | # Test for ClientHello without extensions |
| 3387 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3388 | requires_gnutls |
Gilles Peskine | 7344e1b | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3389 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3390 | "$P_SRV debug_level=3" \ |
| 3391 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3392 | 0 \ |
| 3393 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3394 | |
Gilles Peskine | 7344e1b | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3395 | requires_gnutls |
| 3396 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 3397 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
| 3398 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3399 | 0 \ |
| 3400 | -s "dumping 'client hello extensions' (0 bytes)" |
| 3401 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3402 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3403 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3404 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3405 | "$P_SRV" \ |
| 3406 | "$P_CLI request_size=100" \ |
| 3407 | 0 \ |
| 3408 | -s "Read from client: 100 bytes read$" |
| 3409 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3410 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3411 | "$P_SRV" \ |
| 3412 | "$P_CLI request_size=500" \ |
| 3413 | 0 \ |
| 3414 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3415 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3416 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3417 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3419 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3420 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3421 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3422 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3423 | 0 \ |
| 3424 | -s "Read from client: 1 bytes read" |
| 3425 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3426 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3427 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3428 | "$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] | 3429 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 3430 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3431 | 0 \ |
| 3432 | -s "Read from client: 1 bytes read" |
| 3433 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3434 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3435 | "$P_SRV" \ |
| 3436 | "$P_CLI request_size=1 force_version=tls1 \ |
| 3437 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3438 | 0 \ |
| 3439 | -s "Read from client: 1 bytes read" |
| 3440 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3441 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3442 | "$P_SRV" \ |
| 3443 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 3444 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3445 | 0 \ |
| 3446 | -s "Read from client: 1 bytes read" |
| 3447 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3448 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3449 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3450 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3451 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3452 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3453 | 0 \ |
| 3454 | -s "Read from client: 1 bytes read" |
| 3455 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3457 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3458 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3459 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3460 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3461 | 0 \ |
| 3462 | -s "Read from client: 1 bytes read" |
| 3463 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3464 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3465 | "$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] | 3466 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3467 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3468 | 0 \ |
| 3469 | -s "Read from client: 1 bytes read" |
| 3470 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3471 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3472 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3473 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3474 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3475 | 0 \ |
| 3476 | -s "Read from client: 1 bytes read" |
| 3477 | |
| 3478 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3479 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3480 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3481 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3482 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3483 | 0 \ |
| 3484 | -s "Read from client: 1 bytes read" |
| 3485 | |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3487 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3488 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3489 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3490 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3491 | 0 \ |
| 3492 | -s "Read from client: 1 bytes read" |
| 3493 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3494 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3495 | "$P_SRV" \ |
| 3496 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3497 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3498 | 0 \ |
| 3499 | -s "Read from client: 1 bytes read" |
| 3500 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3501 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3502 | "$P_SRV" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3503 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3505 | 0 \ |
| 3506 | -s "Read from client: 1 bytes read" |
| 3507 | |
| 3508 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3509 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3510 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3511 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3512 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3513 | 0 \ |
| 3514 | -s "Read from client: 1 bytes read" |
| 3515 | |
| 3516 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3517 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3518 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3519 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3520 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3521 | 0 \ |
| 3522 | -s "Read from client: 1 bytes read" |
| 3523 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3524 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3525 | "$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] | 3526 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 3527 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3528 | 0 \ |
| 3529 | -s "Read from client: 1 bytes read" |
| 3530 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3531 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3532 | "$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] | 3533 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3534 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3535 | 0 \ |
| 3536 | -s "Read from client: 1 bytes read" |
| 3537 | |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3539 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3540 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3541 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3542 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3543 | 0 \ |
| 3544 | -s "Read from client: 1 bytes read" |
| 3545 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3546 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3547 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3548 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3549 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3550 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3551 | 0 \ |
| 3552 | -s "Read from client: 1 bytes read" |
| 3553 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3554 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3555 | "$P_SRV" \ |
| 3556 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3558 | 0 \ |
| 3559 | -s "Read from client: 1 bytes read" |
| 3560 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3561 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3562 | "$P_SRV" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3563 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3565 | 0 \ |
| 3566 | -s "Read from client: 1 bytes read" |
| 3567 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3568 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3569 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 3570 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3571 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3572 | 0 \ |
| 3573 | -s "Read from client: 1 bytes read" |
| 3574 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3575 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3576 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3577 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3578 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3579 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3580 | 0 \ |
| 3581 | -s "Read from client: 1 bytes read" |
| 3582 | |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3584 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3585 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3586 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3587 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3588 | 0 \ |
| 3589 | -s "Read from client: 1 bytes read" |
| 3590 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3591 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3592 | "$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] | 3593 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3594 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3595 | 0 \ |
| 3596 | -s "Read from client: 1 bytes read" |
| 3597 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3598 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3599 | "$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] | 3600 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3601 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3602 | 0 \ |
| 3603 | -s "Read from client: 1 bytes read" |
| 3604 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3605 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3606 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3607 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3608 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3609 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3610 | 0 \ |
| 3611 | -s "Read from client: 1 bytes read" |
| 3612 | |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3614 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3615 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 7aae46c | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3616 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3617 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3618 | 0 \ |
| 3619 | -s "Read from client: 1 bytes read" |
| 3620 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3621 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3622 | "$P_SRV" \ |
| 3623 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3625 | 0 \ |
| 3626 | -s "Read from client: 1 bytes read" |
| 3627 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3628 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3629 | "$P_SRV" \ |
| 3630 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 3631 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3632 | 0 \ |
| 3633 | -s "Read from client: 1 bytes read" |
| 3634 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3635 | # Tests for small client packets in DTLS |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3636 | |
| 3637 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3638 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3639 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 3640 | "$P_CLI dtls=1 request_size=1 \ |
| 3641 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3642 | 0 \ |
| 3643 | -s "Read from client: 1 bytes read" |
| 3644 | |
| 3645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3646 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3647 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 3648 | "$P_CLI dtls=1 request_size=1 \ |
| 3649 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3650 | 0 \ |
| 3651 | -s "Read from client: 1 bytes read" |
| 3652 | |
| 3653 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3654 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3655 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3656 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 3657 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3658 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3659 | 0 \ |
| 3660 | -s "Read from client: 1 bytes read" |
| 3661 | |
| 3662 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3663 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3664 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3665 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3666 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3667 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3668 | 0 \ |
| 3669 | -s "Read from client: 1 bytes read" |
| 3670 | |
| 3671 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3672 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3673 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 3674 | "$P_CLI dtls=1 request_size=1 \ |
| 3675 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3676 | 0 \ |
| 3677 | -s "Read from client: 1 bytes read" |
| 3678 | |
| 3679 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3680 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3681 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3682 | "$P_CLI dtls=1 request_size=1 \ |
| 3683 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3684 | 0 \ |
| 3685 | -s "Read from client: 1 bytes read" |
| 3686 | |
| 3687 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3688 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3689 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3690 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3691 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3692 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3693 | 0 \ |
| 3694 | -s "Read from client: 1 bytes read" |
| 3695 | |
| 3696 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3697 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3698 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3699 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3700 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3701 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | 461cb81 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 3702 | 0 \ |
| 3703 | -s "Read from client: 1 bytes read" |
| 3704 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 3705 | # Tests for small server packets |
| 3706 | |
| 3707 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3708 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 3709 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 3710 | "$P_CLI force_version=ssl3 \ |
| 3711 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3712 | 0 \ |
| 3713 | -c "Read from server: 1 bytes read" |
| 3714 | |
| 3715 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3716 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 3717 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3718 | "$P_CLI force_version=ssl3 \ |
| 3719 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3720 | 0 \ |
| 3721 | -c "Read from server: 1 bytes read" |
| 3722 | |
| 3723 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 3724 | "$P_SRV response_size=1" \ |
| 3725 | "$P_CLI force_version=tls1 \ |
| 3726 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3727 | 0 \ |
| 3728 | -c "Read from server: 1 bytes read" |
| 3729 | |
| 3730 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 3731 | "$P_SRV response_size=1" \ |
| 3732 | "$P_CLI force_version=tls1 etm=0 \ |
| 3733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3734 | 0 \ |
| 3735 | -c "Read from server: 1 bytes read" |
| 3736 | |
| 3737 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3738 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 3739 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3740 | "$P_CLI force_version=tls1 \ |
| 3741 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 3742 | 0 \ |
| 3743 | -c "Read from server: 1 bytes read" |
| 3744 | |
| 3745 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3746 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 3747 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3748 | "$P_CLI force_version=tls1 \ |
| 3749 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 3750 | 0 \ |
| 3751 | -c "Read from server: 1 bytes read" |
| 3752 | |
| 3753 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 3754 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3755 | "$P_CLI force_version=tls1 \ |
| 3756 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3757 | 0 \ |
| 3758 | -c "Read from server: 1 bytes read" |
| 3759 | |
| 3760 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 3761 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3762 | "$P_CLI force_version=tls1 \ |
| 3763 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 3764 | 0 \ |
| 3765 | -c "Read from server: 1 bytes read" |
| 3766 | |
| 3767 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3768 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 3769 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3770 | "$P_CLI force_version=tls1 \ |
| 3771 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3772 | 0 \ |
| 3773 | -c "Read from server: 1 bytes read" |
| 3774 | |
| 3775 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3776 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 3777 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3778 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3779 | trunc_hmac=1 etm=0" \ |
| 3780 | 0 \ |
| 3781 | -c "Read from server: 1 bytes read" |
| 3782 | |
| 3783 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 3784 | "$P_SRV response_size=1" \ |
| 3785 | "$P_CLI force_version=tls1_1 \ |
| 3786 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3787 | 0 \ |
| 3788 | -c "Read from server: 1 bytes read" |
| 3789 | |
| 3790 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 3791 | "$P_SRV response_size=1" \ |
| 3792 | "$P_CLI force_version=tls1_1 \ |
| 3793 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 3794 | 0 \ |
| 3795 | -c "Read from server: 1 bytes read" |
| 3796 | |
| 3797 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3798 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 3799 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3800 | "$P_CLI force_version=tls1_1 \ |
| 3801 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 3802 | 0 \ |
| 3803 | -c "Read from server: 1 bytes read" |
| 3804 | |
| 3805 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3806 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 3807 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3808 | "$P_CLI force_version=tls1_1 \ |
| 3809 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 3810 | 0 \ |
| 3811 | -c "Read from server: 1 bytes read" |
| 3812 | |
| 3813 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 3814 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3815 | "$P_CLI force_version=tls1_1 \ |
| 3816 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3817 | 0 \ |
| 3818 | -c "Read from server: 1 bytes read" |
| 3819 | |
| 3820 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 3821 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3822 | "$P_CLI force_version=tls1_1 \ |
| 3823 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 3824 | 0 \ |
| 3825 | -c "Read from server: 1 bytes read" |
| 3826 | |
| 3827 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3828 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 3829 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3830 | "$P_CLI force_version=tls1_1 \ |
| 3831 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3832 | 0 \ |
| 3833 | -c "Read from server: 1 bytes read" |
| 3834 | |
| 3835 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3836 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 3837 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3838 | "$P_CLI force_version=tls1_1 \ |
| 3839 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 3840 | 0 \ |
| 3841 | -c "Read from server: 1 bytes read" |
| 3842 | |
| 3843 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 3844 | "$P_SRV response_size=1" \ |
| 3845 | "$P_CLI force_version=tls1_2 \ |
| 3846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3847 | 0 \ |
| 3848 | -c "Read from server: 1 bytes read" |
| 3849 | |
| 3850 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 3851 | "$P_SRV response_size=1" \ |
| 3852 | "$P_CLI force_version=tls1_2 \ |
| 3853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 3854 | 0 \ |
| 3855 | -c "Read from server: 1 bytes read" |
| 3856 | |
| 3857 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 3858 | "$P_SRV response_size=1" \ |
| 3859 | "$P_CLI force_version=tls1_2 \ |
| 3860 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 3861 | 0 \ |
| 3862 | -c "Read from server: 1 bytes read" |
| 3863 | |
| 3864 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3865 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 3866 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3867 | "$P_CLI force_version=tls1_2 \ |
| 3868 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 3869 | 0 \ |
| 3870 | -c "Read from server: 1 bytes read" |
| 3871 | |
| 3872 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3873 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 3874 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 3875 | "$P_CLI force_version=tls1_2 \ |
| 3876 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 3877 | 0 \ |
| 3878 | -c "Read from server: 1 bytes read" |
| 3879 | |
| 3880 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 3881 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3882 | "$P_CLI force_version=tls1_2 \ |
| 3883 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3884 | 0 \ |
| 3885 | -c "Read from server: 1 bytes read" |
| 3886 | |
| 3887 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 3888 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 3889 | "$P_CLI force_version=tls1_2 \ |
| 3890 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 3891 | 0 \ |
| 3892 | -c "Read from server: 1 bytes read" |
| 3893 | |
| 3894 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3895 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 3896 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3897 | "$P_CLI force_version=tls1_2 \ |
| 3898 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3899 | 0 \ |
| 3900 | -c "Read from server: 1 bytes read" |
| 3901 | |
| 3902 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3903 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 3904 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 3905 | "$P_CLI force_version=tls1_2 \ |
| 3906 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 3907 | 0 \ |
| 3908 | -c "Read from server: 1 bytes read" |
| 3909 | |
| 3910 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 3911 | "$P_SRV response_size=1" \ |
| 3912 | "$P_CLI force_version=tls1_2 \ |
| 3913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 3914 | 0 \ |
| 3915 | -c "Read from server: 1 bytes read" |
| 3916 | |
| 3917 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 3918 | "$P_SRV response_size=1" \ |
| 3919 | "$P_CLI force_version=tls1_2 \ |
| 3920 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 3921 | 0 \ |
| 3922 | -c "Read from server: 1 bytes read" |
| 3923 | |
| 3924 | # Tests for small server packets in DTLS |
| 3925 | |
| 3926 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3927 | run_test "Small server packet DTLS 1.0" \ |
| 3928 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 3929 | "$P_CLI dtls=1 \ |
| 3930 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3931 | 0 \ |
| 3932 | -c "Read from server: 1 bytes read" |
| 3933 | |
| 3934 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3935 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 3936 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 3937 | "$P_CLI dtls=1 \ |
| 3938 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3939 | 0 \ |
| 3940 | -c "Read from server: 1 bytes read" |
| 3941 | |
| 3942 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3943 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3944 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 3945 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 3946 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 3947 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3948 | 0 \ |
| 3949 | -c "Read from server: 1 bytes read" |
| 3950 | |
| 3951 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3952 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3953 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 3954 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 3955 | "$P_CLI dtls=1 \ |
| 3956 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 3957 | 0 \ |
| 3958 | -c "Read from server: 1 bytes read" |
| 3959 | |
| 3960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3961 | run_test "Small server packet DTLS 1.2" \ |
| 3962 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 3963 | "$P_CLI dtls=1 \ |
| 3964 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3965 | 0 \ |
| 3966 | -c "Read from server: 1 bytes read" |
| 3967 | |
| 3968 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3969 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 3970 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 3971 | "$P_CLI dtls=1 \ |
| 3972 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 3973 | 0 \ |
| 3974 | -c "Read from server: 1 bytes read" |
| 3975 | |
| 3976 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3977 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3978 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 3979 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 3980 | "$P_CLI dtls=1 \ |
| 3981 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 3982 | 0 \ |
| 3983 | -c "Read from server: 1 bytes read" |
| 3984 | |
| 3985 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 3986 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 3987 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 3988 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 3989 | "$P_CLI dtls=1 \ |
| 3990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 3991 | 0 \ |
| 3992 | -c "Read from server: 1 bytes read" |
| 3993 | |
Janos Follath | b700c46 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 3994 | # A test for extensions in SSLv3 |
| 3995 | |
| 3996 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3997 | run_test "SSLv3 with extensions, server side" \ |
| 3998 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 3999 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4000 | 0 \ |
| 4001 | -S "dumping 'client hello extensions'" \ |
| 4002 | -S "server hello, total extension length:" |
| 4003 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4004 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4005 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4006 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4007 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4008 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4009 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4010 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4011 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4012 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4013 | -s "Read from client: 16384 bytes read" |
| 4014 | |
Janos Follath | 542ee5d | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4015 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4016 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4017 | "$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] | 4018 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4019 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4020 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4021 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4022 | -s "Read from client: 16384 bytes read" |
| 4023 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4024 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4025 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4026 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4027 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4028 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4029 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4030 | -s "Read from client: 16384 bytes read" |
| 4031 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4032 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4033 | "$P_SRV" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4034 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4035 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4036 | 0 \ |
| 4037 | -s "Read from client: 16384 bytes read" |
| 4038 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4039 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4040 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4041 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4042 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4043 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4044 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4045 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4046 | -s "Read from client: 16384 bytes read" |
| 4047 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4048 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4049 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4050 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4051 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4052 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4053 | 0 \ |
| 4054 | -s "Read from client: 16384 bytes read" |
| 4055 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4056 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4057 | "$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] | 4058 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4059 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4060 | 0 \ |
| 4061 | -s "Read from client: 16384 bytes read" |
| 4062 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4063 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4064 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4065 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4066 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4067 | 0 \ |
| 4068 | -s "Read from client: 16384 bytes read" |
| 4069 | |
| 4070 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4071 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4072 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4073 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4074 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4075 | 0 \ |
| 4076 | -s "Read from client: 16384 bytes read" |
| 4077 | |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4078 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4079 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4080 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4081 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4082 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4083 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4084 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4085 | -s "Read from client: 16384 bytes read" |
| 4086 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4087 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4088 | "$P_SRV" \ |
| 4089 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4090 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4091 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4092 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4093 | -s "Read from client: 16384 bytes read" |
| 4094 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4095 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4096 | "$P_SRV" \ |
| 4097 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4098 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4099 | 0 \ |
| 4100 | -s "Read from client: 16384 bytes read" |
| 4101 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4102 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4103 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4104 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4105 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4106 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4107 | 0 \ |
| 4108 | -s "Read from client: 16384 bytes read" |
| 4109 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4110 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4111 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4112 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4113 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4115 | 0 \ |
| 4116 | -s "Read from client: 16384 bytes read" |
| 4117 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4118 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4119 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4120 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4121 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4122 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4123 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4124 | -s "Read from client: 16384 bytes read" |
| 4125 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4126 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4127 | "$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] | 4128 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4129 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4130 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4131 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4132 | -s "Read from client: 16384 bytes read" |
| 4133 | |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4134 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4135 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4136 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4137 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4138 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4139 | 0 \ |
| 4140 | -s "Read from client: 16384 bytes read" |
| 4141 | |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4143 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4144 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4145 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4146 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4147 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4148 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4149 | -s "Read from client: 16384 bytes read" |
| 4150 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4151 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4152 | "$P_SRV" \ |
| 4153 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4154 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4155 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4156 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4157 | -s "Read from client: 16384 bytes read" |
| 4158 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4159 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4160 | "$P_SRV" \ |
| 4161 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4163 | 0 \ |
| 4164 | -s "Read from client: 16384 bytes read" |
| 4165 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4166 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4167 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4168 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4169 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4170 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4171 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4172 | -s "Read from client: 16384 bytes read" |
| 4173 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4175 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4176 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4177 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4179 | 0 \ |
| 4180 | -s "Read from client: 16384 bytes read" |
| 4181 | |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4182 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4183 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4184 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4185 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4186 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4187 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4188 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4189 | -s "Read from client: 16384 bytes read" |
| 4190 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4191 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4192 | "$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] | 4193 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4194 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4195 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4196 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4197 | -s "Read from client: 16384 bytes read" |
| 4198 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4199 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4200 | "$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] | 4201 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4202 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4203 | 0 \ |
| 4204 | -s "Read from client: 16384 bytes read" |
| 4205 | |
Hanno Becker | a83fafa | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4206 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4207 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4208 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4209 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4210 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4211 | 0 \ |
| 4212 | -s "Read from client: 16384 bytes read" |
| 4213 | |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4214 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4215 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4216 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 0b9d913 | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4217 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 8e75b6c | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4218 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4219 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4220 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4221 | -s "Read from client: 16384 bytes read" |
| 4222 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4223 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4224 | "$P_SRV" \ |
| 4225 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4226 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4227 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4228 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4229 | -s "Read from client: 16384 bytes read" |
| 4230 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4231 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4232 | "$P_SRV" \ |
| 4233 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4234 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4235 | 0 \ |
Hanno Becker | 0d885d3 | 2017-09-18 15:04:19 +0100 | [diff] [blame] | 4236 | -c "16384 bytes written in 1 fragments" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4237 | -s "Read from client: 16384 bytes read" |
| 4238 | |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4239 | # Tests for ECC extensions (rfc 4492) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4240 | |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_AES_C |
| 4242 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4243 | requires_config_enabled MBEDTLS_SHA256_C |
| 4244 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4245 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 4246 | "$P_SRV debug_level=3" \ |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4247 | "$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4248 | 0 \ |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4249 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 4250 | -C "client hello, adding supported_point_formats extension" \ |
| 4251 | -S "found supported elliptic curves extension" \ |
| 4252 | -S "found supported point formats extension" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4253 | |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4254 | requires_config_enabled MBEDTLS_AES_C |
| 4255 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4256 | requires_config_enabled MBEDTLS_SHA256_C |
| 4257 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4258 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4259 | "$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4260 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4261 | 0 \ |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4262 | -C "found supported_point_formats extension" \ |
| 4263 | -S "server hello, supported_point_formats extension" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4264 | |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_AES_C |
| 4266 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4267 | requires_config_enabled MBEDTLS_SHA256_C |
| 4268 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4269 | run_test "Force an ECC ciphersuite in the client side" \ |
| 4270 | "$P_SRV debug_level=3" \ |
| 4271 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4272 | 0 \ |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4273 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 4274 | -c "client hello, adding supported_point_formats extension" \ |
| 4275 | -s "found supported elliptic curves extension" \ |
| 4276 | -s "found supported point formats extension" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4277 | |
Ron Eldor | 2eee2e6 | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4278 | requires_config_enabled MBEDTLS_AES_C |
| 4279 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 4280 | requires_config_enabled MBEDTLS_SHA256_C |
| 4281 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4282 | run_test "Force an ECC ciphersuite in the server side" \ |
| 4283 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 4284 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4285 | 0 \ |
Ron Eldor | b27a1ab | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4286 | -c "found supported_point_formats extension" \ |
| 4287 | -s "server hello, supported_point_formats extension" |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4288 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4289 | # Test for large server packets |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4291 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 4292 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4293 | "$P_CLI force_version=ssl3 \ |
| 4294 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4295 | 0 \ |
| 4296 | -c "Read from server: 16384 bytes read" |
| 4297 | |
Andrzej Kurek | 1010831 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 4298 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 4299 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4300 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 4301 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 4302 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 4303 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4304 | 0 \ |
| 4305 | -c "Read from server: 1 bytes read"\ |
| 4306 | -c "16383 bytes read"\ |
| 4307 | -C "Read from server: 16384 bytes read" |
| 4308 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4309 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 4310 | "$P_SRV response_size=16384" \ |
| 4311 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 4312 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4313 | 0 \ |
| 4314 | -c "Read from server: 1 bytes read"\ |
| 4315 | -c "16383 bytes read"\ |
| 4316 | -C "Read from server: 16384 bytes read" |
| 4317 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4318 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4319 | "$P_SRV response_size=16384" \ |
| 4320 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 4321 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4322 | 0 \ |
| 4323 | -c "Read from server: 1 bytes read"\ |
| 4324 | -c "16383 bytes read"\ |
| 4325 | -C "Read from server: 16384 bytes read" |
| 4326 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4328 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 4329 | "$P_SRV response_size=16384" \ |
| 4330 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 4331 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 4332 | trunc_hmac=1" \ |
| 4333 | 0 \ |
| 4334 | -c "Read from server: 1 bytes read"\ |
| 4335 | -c "16383 bytes read"\ |
| 4336 | -C "Read from server: 16384 bytes read" |
| 4337 | |
| 4338 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4339 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 4340 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4341 | "$P_CLI force_version=tls1 \ |
| 4342 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4343 | trunc_hmac=1" \ |
| 4344 | 0 \ |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4345 | -s "16384 bytes written in 1 fragments" \ |
| 4346 | -c "Read from server: 16384 bytes read" |
| 4347 | |
| 4348 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 4349 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4350 | "$P_CLI force_version=tls1 \ |
| 4351 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4352 | 0 \ |
| 4353 | -s "16384 bytes written in 1 fragments" \ |
| 4354 | -c "Read from server: 16384 bytes read" |
| 4355 | |
| 4356 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4357 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4358 | "$P_CLI force_version=tls1 \ |
| 4359 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4360 | 0 \ |
| 4361 | -s "16384 bytes written in 1 fragments" \ |
| 4362 | -c "Read from server: 16384 bytes read" |
| 4363 | |
| 4364 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4365 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4366 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4367 | "$P_CLI force_version=tls1 \ |
| 4368 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4369 | 0 \ |
| 4370 | -s "16384 bytes written in 1 fragments" \ |
| 4371 | -c "Read from server: 16384 bytes read" |
| 4372 | |
| 4373 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4374 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4375 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4376 | "$P_CLI force_version=tls1 \ |
| 4377 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4378 | 0 \ |
| 4379 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4380 | -c "Read from server: 16384 bytes read" |
| 4381 | |
| 4382 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 4383 | "$P_SRV response_size=16384" \ |
| 4384 | "$P_CLI force_version=tls1_1 \ |
| 4385 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4386 | 0 \ |
| 4387 | -c "Read from server: 16384 bytes read" |
| 4388 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4389 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4390 | "$P_SRV response_size=16384" \ |
| 4391 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 4392 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4393 | 0 \ |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4394 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4395 | -c "Read from server: 16384 bytes read" |
| 4396 | |
| 4397 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4398 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 4399 | "$P_SRV response_size=16384" \ |
| 4400 | "$P_CLI force_version=tls1_1 \ |
| 4401 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 4402 | trunc_hmac=1" \ |
| 4403 | 0 \ |
| 4404 | -c "Read from server: 16384 bytes read" |
| 4405 | |
| 4406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4407 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4408 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 4409 | "$P_CLI force_version=tls1_1 \ |
| 4410 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4411 | 0 \ |
| 4412 | -s "16384 bytes written in 1 fragments" \ |
| 4413 | -c "Read from server: 16384 bytes read" |
| 4414 | |
| 4415 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 4416 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4417 | "$P_CLI force_version=tls1_1 \ |
| 4418 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4419 | 0 \ |
| 4420 | -c "Read from server: 16384 bytes read" |
| 4421 | |
| 4422 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4423 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4424 | "$P_CLI force_version=tls1_1 \ |
| 4425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4426 | 0 \ |
| 4427 | -s "16384 bytes written in 1 fragments" \ |
| 4428 | -c "Read from server: 16384 bytes read" |
| 4429 | |
| 4430 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4431 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 4432 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4433 | "$P_CLI force_version=tls1_1 \ |
| 4434 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4435 | trunc_hmac=1" \ |
| 4436 | 0 \ |
| 4437 | -c "Read from server: 16384 bytes read" |
| 4438 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4439 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4440 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4441 | "$P_CLI force_version=tls1_1 \ |
| 4442 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4443 | 0 \ |
| 4444 | -s "16384 bytes written in 1 fragments" \ |
| 4445 | -c "Read from server: 16384 bytes read" |
| 4446 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4447 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 4448 | "$P_SRV response_size=16384" \ |
| 4449 | "$P_CLI force_version=tls1_2 \ |
| 4450 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4451 | 0 \ |
| 4452 | -c "Read from server: 16384 bytes read" |
| 4453 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4454 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4455 | "$P_SRV response_size=16384" \ |
| 4456 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 4457 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4458 | 0 \ |
| 4459 | -s "16384 bytes written in 1 fragments" \ |
| 4460 | -c "Read from server: 16384 bytes read" |
| 4461 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4462 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4463 | "$P_SRV response_size=16384" \ |
| 4464 | "$P_CLI force_version=tls1_2 \ |
| 4465 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4466 | 0 \ |
| 4467 | -c "Read from server: 16384 bytes read" |
| 4468 | |
| 4469 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4470 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 4471 | "$P_SRV response_size=16384" \ |
| 4472 | "$P_CLI force_version=tls1_2 \ |
| 4473 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 4474 | trunc_hmac=1" \ |
| 4475 | 0 \ |
| 4476 | -c "Read from server: 16384 bytes read" |
| 4477 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4478 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4479 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 4480 | "$P_CLI force_version=tls1_2 \ |
| 4481 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4482 | 0 \ |
| 4483 | -s "16384 bytes written in 1 fragments" \ |
| 4484 | -c "Read from server: 16384 bytes read" |
| 4485 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4486 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 4487 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4488 | "$P_CLI force_version=tls1_2 \ |
| 4489 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4490 | 0 \ |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4491 | -s "16384 bytes written in 1 fragments" \ |
| 4492 | -c "Read from server: 16384 bytes read" |
| 4493 | |
| 4494 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4495 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4496 | "$P_CLI force_version=tls1_2 \ |
| 4497 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4498 | 0 \ |
| 4499 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4500 | -c "Read from server: 16384 bytes read" |
| 4501 | |
| 4502 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4503 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 4504 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4505 | "$P_CLI force_version=tls1_2 \ |
| 4506 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4507 | trunc_hmac=1" \ |
| 4508 | 0 \ |
| 4509 | -c "Read from server: 16384 bytes read" |
| 4510 | |
Andrzej Kurek | 4115a8c | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4511 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4512 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4513 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4514 | "$P_CLI force_version=tls1_2 \ |
| 4515 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4516 | 0 \ |
| 4517 | -s "16384 bytes written in 1 fragments" \ |
| 4518 | -c "Read from server: 16384 bytes read" |
| 4519 | |
Andrzej Kurek | f4f59c0 | 2018-06-28 03:42:01 -0400 | [diff] [blame] | 4520 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 4521 | "$P_SRV response_size=16384" \ |
| 4522 | "$P_CLI force_version=tls1_2 \ |
| 4523 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4524 | 0 \ |
| 4525 | -c "Read from server: 16384 bytes read" |
| 4526 | |
| 4527 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 4528 | "$P_SRV response_size=16384" \ |
| 4529 | "$P_CLI force_version=tls1_2 \ |
| 4530 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4531 | 0 \ |
| 4532 | -c "Read from server: 16384 bytes read" |
| 4533 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4534 | # Tests for DTLS HelloVerifyRequest |
| 4535 | |
| 4536 | run_test "DTLS cookie: enabled" \ |
| 4537 | "$P_SRV dtls=1 debug_level=2" \ |
| 4538 | "$P_CLI dtls=1 debug_level=2" \ |
| 4539 | 0 \ |
| 4540 | -s "cookie verification failed" \ |
| 4541 | -s "cookie verification passed" \ |
| 4542 | -S "cookie verification skipped" \ |
| 4543 | -c "received hello verify request" \ |
| 4544 | -s "hello verification requested" \ |
| 4545 | -S "SSL - The requested feature is not available" |
| 4546 | |
| 4547 | run_test "DTLS cookie: disabled" \ |
| 4548 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 4549 | "$P_CLI dtls=1 debug_level=2" \ |
| 4550 | 0 \ |
| 4551 | -S "cookie verification failed" \ |
| 4552 | -S "cookie verification passed" \ |
| 4553 | -s "cookie verification skipped" \ |
| 4554 | -C "received hello verify request" \ |
| 4555 | -S "hello verification requested" \ |
| 4556 | -S "SSL - The requested feature is not available" |
| 4557 | |
| 4558 | run_test "DTLS cookie: default (failing)" \ |
| 4559 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 4560 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 4561 | 1 \ |
| 4562 | -s "cookie verification failed" \ |
| 4563 | -S "cookie verification passed" \ |
| 4564 | -S "cookie verification skipped" \ |
| 4565 | -C "received hello verify request" \ |
| 4566 | -S "hello verification requested" \ |
| 4567 | -s "SSL - The requested feature is not available" |
| 4568 | |
| 4569 | requires_ipv6 |
| 4570 | run_test "DTLS cookie: enabled, IPv6" \ |
| 4571 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 4572 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 4573 | 0 \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4574 | -s "cookie verification failed" \ |
| 4575 | -s "cookie verification passed" \ |
| 4576 | -S "cookie verification skipped" \ |
| 4577 | -c "received hello verify request" \ |
| 4578 | -s "hello verification requested" \ |
| 4579 | -S "SSL - The requested feature is not available" |
| 4580 | |
| 4581 | run_test "DTLS cookie: enabled, nbio" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4582 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4583 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4584 | 0 \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4585 | -s "cookie verification failed" \ |
| 4586 | -s "cookie verification passed" \ |
| 4587 | -S "cookie verification skipped" \ |
| 4588 | -c "received hello verify request" \ |
| 4589 | -s "hello verification requested" \ |
| 4590 | -S "SSL - The requested feature is not available" |
| 4591 | |
| 4592 | # Tests for client reconnecting from the same port with DTLS |
| 4593 | |
| 4594 | not_with_valgrind # spurious resend |
| 4595 | run_test "DTLS client reconnect from same port: reference" \ |
| 4596 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4597 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000" \ |
| 4598 | 0 \ |
| 4599 | -C "resend" \ |
| 4600 | -S "The operation timed out" \ |
| 4601 | -S "Client initiated reconnection from same port" |
| 4602 | |
| 4603 | not_with_valgrind # spurious resend |
| 4604 | run_test "DTLS client reconnect from same port: reconnect" \ |
| 4605 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 4606 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4607 | 0 \ |
| 4608 | -C "resend" \ |
| 4609 | -S "The operation timed out" \ |
| 4610 | -s "Client initiated reconnection from same port" |
| 4611 | |
| 4612 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 4613 | run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \ |
| 4614 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 4615 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
| 4616 | 0 \ |
| 4617 | -S "The operation timed out" \ |
| 4618 | -s "Client initiated reconnection from same port" |
| 4619 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4620 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4621 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4622 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4623 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 4624 | 0 \ |
| 4625 | -S "The operation timed out" \ |
| 4626 | -s "Client initiated reconnection from same port" |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4627 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4628 | run_test "DTLS client reconnect from same port: no cookies" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4629 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \ |
| 4630 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 4631 | 0 \ |
| 4632 | -s "The operation timed out" \ |
| 4633 | -S "Client initiated reconnection from same port" |
| 4634 | |
| 4635 | # Tests for various cases of client authentication with DTLS |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4636 | # (focused on handshake flows and message parsing) |
| 4637 | |
| 4638 | run_test "DTLS client auth: required" \ |
| 4639 | "$P_SRV dtls=1 auth_mode=required" \ |
| 4640 | "$P_CLI dtls=1" \ |
| 4641 | 0 \ |
| 4642 | -s "Verifying peer X.509 certificate... ok" |
| 4643 | |
| 4644 | run_test "DTLS client auth: optional, client has no cert" \ |
| 4645 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 4646 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 4647 | 0 \ |
| 4648 | -s "! Certificate was missing" |
| 4649 | |
| 4650 | run_test "DTLS client auth: none, client has no cert" \ |
| 4651 | "$P_SRV dtls=1 auth_mode=none" \ |
| 4652 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 4653 | 0 \ |
| 4654 | -c "skip write certificate$" \ |
| 4655 | -s "! Certificate verification was skipped" |
| 4656 | |
| 4657 | run_test "DTLS wrong PSK: badmac alert" \ |
| 4658 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 4659 | "$P_CLI dtls=1 psk=abc124" \ |
| 4660 | 1 \ |
| 4661 | -s "SSL - Verification of the message MAC failed" \ |
| 4662 | -c "SSL - A fatal alert message was received from our peer" |
| 4663 | |
| 4664 | # Tests for receiving fragmented handshake messages with DTLS |
| 4665 | |
| 4666 | requires_gnutls |
| 4667 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 4668 | "$G_SRV -u --mtu 2048 -a" \ |
| 4669 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4670 | 0 \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4671 | -C "found fragmented DTLS handshake message" \ |
| 4672 | -C "error" |
| 4673 | |
| 4674 | requires_gnutls |
| 4675 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 4676 | "$G_SRV -u --mtu 512" \ |
| 4677 | "$P_CLI dtls=1 debug_level=2" \ |
| 4678 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4679 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4680 | -C "error" |
| 4681 | |
| 4682 | requires_gnutls |
| 4683 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4684 | "$G_SRV -u --mtu 128" \ |
| 4685 | "$P_CLI dtls=1 debug_level=2" \ |
| 4686 | 0 \ |
| 4687 | -c "found fragmented DTLS handshake message" \ |
| 4688 | -C "error" |
| 4689 | |
| 4690 | requires_gnutls |
| 4691 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4692 | "$G_SRV -u --mtu 128" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4693 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4694 | 0 \ |
| 4695 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4696 | -C "error" |
| 4697 | |
| 4698 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 4699 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4700 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 4701 | "$G_SRV -u --mtu 256" \ |
| 4702 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4703 | 0 \ |
| 4704 | -c "found fragmented DTLS handshake message" \ |
| 4705 | -c "client hello, adding renegotiation extension" \ |
| 4706 | -c "found renegotiation extension" \ |
| 4707 | -c "=> renegotiate" \ |
| 4708 | -C "mbedtls_ssl_handshake returned" \ |
| 4709 | -C "error" \ |
| 4710 | -s "Extra-header:" |
| 4711 | |
| 4712 | requires_gnutls |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 4713 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4714 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 4715 | "$G_SRV -u --mtu 256" \ |
| 4716 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 4717 | 0 \ |
| 4718 | -c "found fragmented DTLS handshake message" \ |
| 4719 | -c "client hello, adding renegotiation extension" \ |
| 4720 | -c "found renegotiation extension" \ |
| 4721 | -c "=> renegotiate" \ |
| 4722 | -C "mbedtls_ssl_handshake returned" \ |
| 4723 | -C "error" \ |
| 4724 | -s "Extra-header:" |
| 4725 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4726 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 4727 | "$O_SRV -dtls1 -mtu 2048" \ |
| 4728 | "$P_CLI dtls=1 debug_level=2" \ |
| 4729 | 0 \ |
| 4730 | -C "found fragmented DTLS handshake message" \ |
| 4731 | -C "error" |
| 4732 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4733 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 4734 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4735 | "$P_CLI dtls=1 debug_level=2" \ |
| 4736 | 0 \ |
| 4737 | -c "found fragmented DTLS handshake message" \ |
| 4738 | -C "error" |
| 4739 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4740 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 4741 | "$O_SRV -dtls1 -mtu 256" \ |
| 4742 | "$P_CLI dtls=1 debug_level=2" \ |
| 4743 | 0 \ |
| 4744 | -c "found fragmented DTLS handshake message" \ |
| 4745 | -C "error" |
| 4746 | |
| 4747 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 4748 | "$O_SRV -dtls1 -mtu 256" \ |
| 4749 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 4750 | 0 \ |
| 4751 | -c "found fragmented DTLS handshake message" \ |
| 4752 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4753 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4754 | # Tests for specific things with "unreliable" UDP connection |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4755 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4756 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4757 | run_test "DTLS proxy: reference" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 4758 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4759 | "$P_SRV dtls=1 debug_level=2" \ |
| 4760 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4761 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4762 | -C "replayed record" \ |
| 4763 | -S "replayed record" \ |
| 4764 | -C "record from another epoch" \ |
| 4765 | -S "record from another epoch" \ |
| 4766 | -C "discarding invalid record" \ |
| 4767 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4768 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4769 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4770 | -c "HTTP/1.0 200 OK" |
| 4771 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4772 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4773 | run_test "DTLS proxy: duplicate every packet" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4774 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4775 | "$P_SRV dtls=1 debug_level=2" \ |
| 4776 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 4777 | 0 \ |
Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 4778 | -c "replayed record" \ |
| 4779 | -s "replayed record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4780 | -c "discarding invalid record" \ |
| 4781 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4782 | -S "resend" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 4783 | -s "Extra-header:" \ |
| 4784 | -c "HTTP/1.0 200 OK" |
| 4785 | |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4786 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 4787 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4788 | "$P_SRV dtls=1 debug_level=2 anti_replay=0" \ |
| 4789 | "$P_CLI dtls=1 debug_level=2" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4790 | 0 \ |
| 4791 | -c "replayed record" \ |
| 4792 | -S "replayed record" \ |
| 4793 | -c "discarding invalid record" \ |
| 4794 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 4795 | -c "resend" \ |
| 4796 | -s "resend" \ |
Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 4797 | -s "Extra-header:" \ |
| 4798 | -c "HTTP/1.0 200 OK" |
| 4799 | |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4800 | 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] | 4801 | -p "$P_PXY bad_ad=1" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4802 | "$P_SRV dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4803 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4804 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4805 | -c "discarding invalid record (mac)" \ |
| 4806 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4807 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4808 | -c "HTTP/1.0 200 OK" \ |
| 4809 | -S "too many records with bad MAC" \ |
| 4810 | -S "Verification of the message MAC failed" |
| 4811 | |
| 4812 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 4813 | -p "$P_PXY bad_ad=1" \ |
| 4814 | "$P_SRV dtls=1 debug_level=1 badmac_limit=1" \ |
| 4815 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4816 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4817 | -C "discarding invalid record (mac)" \ |
| 4818 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4819 | -S "Extra-header:" \ |
| 4820 | -C "HTTP/1.0 200 OK" \ |
| 4821 | -s "too many records with bad MAC" \ |
| 4822 | -s "Verification of the message MAC failed" |
| 4823 | |
| 4824 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 4825 | -p "$P_PXY bad_ad=1" \ |
| 4826 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2" \ |
| 4827 | "$P_CLI dtls=1 debug_level=1 read_timeout=100" \ |
| 4828 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4829 | -c "discarding invalid record (mac)" \ |
| 4830 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4831 | -s "Extra-header:" \ |
| 4832 | -c "HTTP/1.0 200 OK" \ |
| 4833 | -S "too many records with bad MAC" \ |
| 4834 | -S "Verification of the message MAC failed" |
| 4835 | |
| 4836 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 4837 | -p "$P_PXY bad_ad=1" \ |
| 4838 | "$P_SRV dtls=1 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 4839 | "$P_CLI dtls=1 debug_level=1 read_timeout=100 exchanges=2" \ |
| 4840 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 4841 | -c "discarding invalid record (mac)" \ |
| 4842 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 4843 | -s "Extra-header:" \ |
| 4844 | -c "HTTP/1.0 200 OK" \ |
| 4845 | -s "too many records with bad MAC" \ |
| 4846 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4847 | |
| 4848 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4849 | -p "$P_PXY delay_ccs=1" \ |
| 4850 | "$P_SRV dtls=1 debug_level=1" \ |
| 4851 | "$P_CLI dtls=1 debug_level=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4852 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4853 | -c "record from another epoch" \ |
| 4854 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4855 | -c "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 4856 | -s "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4857 | -s "Extra-header:" \ |
| 4858 | -c "HTTP/1.0 200 OK" |
| 4859 | |
Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 4860 | # 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] | 4861 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4862 | needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4863 | 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] | 4864 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4865 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4866 | psk=abc123" \ |
| 4867 | "$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] | 4868 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4869 | 0 \ |
| 4870 | -s "Extra-header:" \ |
| 4871 | -c "HTTP/1.0 200 OK" |
| 4872 | |
| 4873 | needs_more_time 2 |
| 4874 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 4875 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4876 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4877 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4878 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4879 | 0 \ |
| 4880 | -s "Extra-header:" \ |
| 4881 | -c "HTTP/1.0 200 OK" |
| 4882 | |
| 4883 | needs_more_time 2 |
| 4884 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 4885 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4886 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none" \ |
| 4887 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4888 | 0 \ |
| 4889 | -s "Extra-header:" \ |
| 4890 | -c "HTTP/1.0 200 OK" |
| 4891 | |
| 4892 | needs_more_time 2 |
| 4893 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 4894 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4895 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=required" \ |
| 4896 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4897 | 0 \ |
| 4898 | -s "Extra-header:" \ |
| 4899 | -c "HTTP/1.0 200 OK" |
| 4900 | |
| 4901 | needs_more_time 2 |
| 4902 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 4903 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4904 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=none" \ |
| 4905 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 4906 | 0 \ |
| 4907 | -s "Extra-header:" \ |
| 4908 | -c "HTTP/1.0 200 OK" |
| 4909 | |
| 4910 | needs_more_time 2 |
| 4911 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 4912 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4913 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=1 auth_mode=required" \ |
| 4914 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4915 | 0 \ |
| 4916 | -s "Extra-header:" \ |
| 4917 | -c "HTTP/1.0 200 OK" |
| 4918 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4919 | needs_more_time 2 |
| 4920 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 4921 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4922 | "$P_SRV dtls=1 hs_timeout=250-10000 nbio=2 tickets=1 \ |
| 4923 | auth_mode=required" \ |
| 4924 | "$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] | 4925 | 0 \ |
| 4926 | -s "Extra-header:" \ |
| 4927 | -c "HTTP/1.0 200 OK" |
| 4928 | |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 4929 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 4930 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 4931 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 4932 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4933 | psk=abc123 debug_level=3" \ |
| 4934 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 4935 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 4936 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4937 | 0 \ |
| 4938 | -s "a session has been resumed" \ |
| 4939 | -c "a session has been resumed" \ |
| 4940 | -s "Extra-header:" \ |
| 4941 | -c "HTTP/1.0 200 OK" |
| 4942 | |
| 4943 | needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 4944 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 4945 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 4946 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4947 | psk=abc123 debug_level=3 nbio=2" \ |
| 4948 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 4949 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 4950 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 4951 | 0 \ |
| 4952 | -s "a session has been resumed" \ |
| 4953 | -c "a session has been resumed" \ |
| 4954 | -s "Extra-header:" \ |
| 4955 | -c "HTTP/1.0 200 OK" |
| 4956 | |
| 4957 | needs_more_time 4 |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 4958 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4959 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 4960 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4961 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4962 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 4963 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 4964 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 4965 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4966 | 0 \ |
| 4967 | -c "=> renegotiate" \ |
| 4968 | -s "=> renegotiate" \ |
| 4969 | -s "Extra-header:" \ |
| 4970 | -c "HTTP/1.0 200 OK" |
| 4971 | |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4972 | needs_more_time 4 |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4974 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 4975 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 4976 | "$P_SRV dtls=1 hs_timeout=250-10000 tickets=0 auth_mode=none \ |
| 4977 | psk=abc123 renegotiation=1 debug_level=2" \ |
| 4978 | "$P_CLI dtls=1 hs_timeout=250-10000 tickets=0 psk=abc123 \ |
| 4979 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 4980 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4981 | 0 \ |
| 4982 | -c "=> renegotiate" \ |
| 4983 | -s "=> renegotiate" \ |
| 4984 | -s "Extra-header:" \ |
| 4985 | -c "HTTP/1.0 200 OK" |
| 4986 | |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4987 | needs_more_time 4 |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 4988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4989 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 4990 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4991 | "$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] | 4992 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4993 | debug_level=2" \ |
| 4994 | "$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] | 4995 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 4996 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 4997 | 0 \ |
| 4998 | -c "=> renegotiate" \ |
| 4999 | -s "=> renegotiate" \ |
| 5000 | -s "Extra-header:" \ |
| 5001 | -c "HTTP/1.0 200 OK" |
| 5002 | |
| 5003 | needs_more_time 4 |
Hanno Becker | 7889113 | 2017-10-24 11:54:55 +0100 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5005 | 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] | 5006 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5007 | "$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] | 5008 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5009 | debug_level=2 nbio=2" \ |
| 5010 | "$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] | 5011 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 5012 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 5013 | 0 \ |
| 5014 | -c "=> renegotiate" \ |
| 5015 | -s "=> renegotiate" \ |
| 5016 | -s "Extra-header:" \ |
| 5017 | -c "HTTP/1.0 200 OK" |
| 5018 | |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 5019 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5020 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5021 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5022 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5023 | "$O_SRV -dtls1 -mtu 2048" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5024 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5025 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 5026 | -c "HTTP/1.0 200 OK" |
| 5027 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 5028 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5029 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5030 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 5031 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5032 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5033 | "$P_CLI dtls=1 hs_timeout=250-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5034 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5035 | -c "HTTP/1.0 200 OK" |
| 5036 | |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 5037 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5038 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5039 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 5040 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 5041 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 8fe411e | 2015-03-09 16:09:53 +0000 | [diff] [blame] | 5042 | "$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] | 5043 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5044 | -c "HTTP/1.0 200 OK" |
| 5045 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5046 | requires_gnutls |
Manuel Pégourié-Gonnard | 127ab88 | 2014-10-09 17:59:32 +0200 | [diff] [blame] | 5047 | needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5048 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5049 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 5050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5051 | "$G_SRV -u --mtu 2048 -a" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5052 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5053 | 0 \ |
| 5054 | -s "Extra-header:" \ |
| 5055 | -c "Extra-header:" |
| 5056 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5057 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 5058 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5059 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5060 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 5061 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5062 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5063 | "$P_CLI dtls=1 hs_timeout=250-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 5064 | 0 \ |
| 5065 | -s "Extra-header:" \ |
| 5066 | -c "Extra-header:" |
| 5067 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5068 | requires_gnutls |
Manuel Pégourié-Gonnard | 2240486 | 2015-05-14 12:11:45 +0200 | [diff] [blame] | 5069 | needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 5070 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5071 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 5072 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 5073 | "$G_SRV -u --mtu 512" \ |
Manuel Pégourié-Gonnard | f138447 | 2014-10-14 22:57:46 +0200 | [diff] [blame] | 5074 | "$P_CLI dtls=1 hs_timeout=250-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 5075 | 0 \ |
| 5076 | -s "Extra-header:" \ |
| 5077 | -c "Extra-header:" |
| 5078 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 5079 | # Final report |
| 5080 | |
| 5081 | echo "------------------------------------------------------------------------" |
| 5082 | |
| 5083 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5084 | printf "PASSED" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 5085 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 5086 | printf "FAILED" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 5087 | fi |
| 5088 | PASSES=$(( $TESTS - $FAILS )) |
| 5089 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 5090 | |
| 5091 | exit $FAILS |